-
- Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Description
Bug report
ast.parse()
uses the assert statement to validate the feature_version
argument:
$ python3 -c 'import ast; ast.parse("print", feature_version=(2, 7))' Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/jwilk/.local/lib/python3.11/ast.py", line 45, in parse assert major == 3 AssertionError
This is bad because the check will go away if you enable optimizations:
$ python3 -O -c 'import ast; ast.parse("print", feature_version=(2, 7))' && echo yay yay
Your environment
Python 3.11.0b4
Metadata
Metadata
Assignees
Labels
No labels