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 gousaiyang
Recipients gousaiyang
Date 2020-09-30.18:55:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601492104.09.0.103643328706.issue41897@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-09-30 18:55:04gousaiyangsetrecipients: + gousaiyang
2020-09-30 18:55:04gousaiyangsetmessageid: <1601492104.09.0.103643328706.issue41897@roundup.psfhosted.org>
2020-09-30 18:55:04gousaiyanglinkissue41897 messages
2020-09-30 18:55:03gousaiyangcreate