[issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed

Terry J. Reedy report at bugs.python.org
Thu Jan 14 20:52:49 EST 2021


Terry J. Reedy <tjreedy at udel.edu> added the comment:

In order to test code.InteractiveCompiler (used by IDLE) and codeop._maybe_compile (which IC calls), which calls compile() 3 times with mode 'single', I entered the example as 2 or 3 lines in Shell.
>>> [file for str(file) in []  # Error highlight on 's'.
 ]
SyntaxError: cannot assign to function call

Breaking the expression elsewhere, including before 'str', gives the same message and highlighted 's'.

I did not test before recompiling but it is certainly correct now.

----------

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


More information about the Python-bugs-list mailing list