[issue39909] Assignment expression in assert causes SyntaxError

Михаил Кыштымов report at bugs.python.org
Mon Mar 9 04:21:48 EDT 2020


Михаил Кыштымов <mister.rend at gmail.com> added the comment:

if this is by design i'm fine with somebody closing this issue.

i've not found mention of such case in pep so i though it's not by design.
docs say `assert` just takes "expression" and "assignment expression" has "expression" in it's name.
https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement

workaraund does not look as cool because of parentheses.

again, if this is "as intended" i'm fine with closing issue.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39909>
_______________________________________


More information about the Python-bugs-list mailing list