Message377717
ast.parse in Python 3.9 does not produce SyntaxError for assignment to __debug__:
```
>>> import ast
>>> ast.dump(ast.parse('__debug__ = 0'))
"Module(body=[Assign(targets=[Name(id='__debug__', ctx=Store())], value=Constant(value=0))], type_ignores=[])"
>>> exec('__debug__ = 0')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1
SyntaxError: cannot assign to __debug__
```
In Python 3.8 a SyntaxError was properly raised. Probably this is due to the new PEG parser. |
|
Date |
User |
Action |
Args |
2020-09-30 18:55:04 | gousaiyang | set | recipients:
+ gousaiyang |
2020-09-30 18:55:04 | gousaiyang | set | messageid: <1601492104.09.0.103643328706.issue41897@roundup.psfhosted.org> |
2020-09-30 18:55:04 | gousaiyang | link | issue41897 messages |
2020-09-30 18:55:03 | gousaiyang | create | |
|