-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
In the Python.asdl
syntax description, the file asserts that Dict
literal keys
have type expr*
. This is false. keys
can be optional.
In the ast documentation for Python:
- https://docs.python.org/3/library/ast.html#ast.Dict it is made clear that:
When doing dictionary unpacking using dictionary literals the expression to be expanded goes in the values list, with a None at the corresponding position in keys.
Hence, keys is really a expr?* and not a expr*.
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error