New GitHub issue #95066 from jwilk:<br>
<hr>
<pre>
**Bug report**
`ast.parse()` uses the assert statement to validate the `feature_version` argument:
```console
$ 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:
```console
$ python3 -O -c 'import ast; ast.parse("print", feature_version=(2, 7))' && echo yay
yay
```
**Your environment**
Python 3.11.0b4
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/95066">View on GitHub</a>
<p>Labels: </p>
<p>Assignee: </p>