Skip to content

Wrong Python.asdl type for keys in Dict literals #131421

Open
@Demonstrandum

Description

@Demonstrandum

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    • Status

      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions