This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Михаил Кыштымов
Recipients Михаил Кыштымов
Date 2020-03-09.07:26:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583738764.77.0.124975430682.issue39909@roundup.psfhosted.org>
In-reply-to
Content
Assignment expression in assert causes SyntaxError

Minimal case:
```
assert var := None
```

Error:
```
  File "<input>", line 1
    assert var := None
               ^
SyntaxError: invalid syntax
```

Workaround:
```
assert (var := None)
```

My use case:
```
my_dict = dict()
assert value := my_dict.get('key')
```
History
Date User Action Args
2020-03-09 07:26:04Михаил Кыштымовsetrecipients: + Михаил Кыштымов
2020-03-09 07:26:04Михаил Кыштымовsetmessageid: <1583738764.77.0.124975430682.issue39909@roundup.psfhosted.org>
2020-03-09 07:26:04Михаил Кыштымовlinkissue39909 messages
2020-03-09 07:26:04Михаил Кыштымовcreate