-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Closed
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
$ ./python
Python 3.14.0a4+ (heads/test:d906bde250, Feb 2 2025, 11:08:38) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> a = ast.parse('i = 1; j = 2', mode='single')
>>> print(ast.dump(a, indent=2))
Interactive(
body=[
Assign(
targets=[
Name(id='i', ctx=Store())],
value=Constant(value=1)),
Assign(
targets=[
Name(id='j', ctx=Store())],
value=Constant(value=2))])
>>> ast.unparse(a)
'j = 2'
My guess the ast.parse()
should probably error?
CPython versions tested on:
3.14, 3.12, 3.13, 3.11, 3.10
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error