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:
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
In the
Python.asdlsyntax description, the file asserts thatDictliteralkeyshave typeexpr*. This is false.keyscan be optional.In the ast documentation for Python:
Hence, keys is really a expr?* and not a expr*.
Linked PRs
Dictto have anexpr?*keys field #131419kw_defaultsbeingexpr*instead ofexpr?*(+ fix docs ASDL highlighting) #133773expr*instead ofexpr?*(GH-133773) #143269