-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
>>> ast.parse(ast.Constant(42))
Constant(value=42, kind=None)
>>> ast.parse(ast.Constant(42), optimize=True)
Traceback (most recent call last):
File "<python-input-4>", line 1, in <module>
ast.parse(ast.Constant(42), optimize=True)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/ast.py", line 53, in parse
return compile(source, filename, mode, flags,
_feature_version=feature_version, optimize=optimize)
TypeError: expected Module node, got Constant
(This came up while implementing PEP 765 #130080).
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement