Message338143
Seems like compile() can't properly handle assignment expressions parsed in AST object.
Python 3.8.0a2+ (heads/master:06e1e68, Mar 17 2019, 14:27:19)
[Clang 10.0.0 (clang-1000.10.44.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> compile("if a == 1:\n True", '<string>', 'exec')
<code object <module> at 0x10a59ef60, file "<string>", line 1>
>>> compile(ast.parse("if a == 1:\n True"), '<string>', 'exec')
<code object <module> at 0x10a5f6780, file "<string>", line 1>
>>> compile("if a := 1:\n True", '<string>', 'exec')
<code object <module> at 0x10a59ef60, file "<string>", line 1>
>>> compile(ast.parse("if a := 1:\n True"), '<string>', 'exec')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: unexpected expression
>>>
This issue seems to break IPython when trying to use any assignment expressions.
https://github.com/ipython/ipython/issues/11618 |
|
Date |
User |
Action |
Args |
2019-03-17 22:10:50 | tomyun | set | recipients:
+ tomyun |
2019-03-17 22:10:50 | tomyun | set | messageid: <1552860650.83.0.184007481233.issue36332@roundup.psfhosted.org> |
2019-03-17 22:10:50 | tomyun | link | issue36332 messages |
2019-03-17 22:10:50 | tomyun | create | |
|