]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-131421: fix ASDL grammar for `Dict` to have an `expr?*` keys field (#131419)
authorSamuel <samuel@knutsen.co>
Sun, 4 May 2025 23:03:38 +0000 (00:03 +0100)
committerGitHub <noreply@github.com>
Sun, 4 May 2025 23:03:38 +0000 (16:03 -0700)
commit30840706b029645b9631b92c687834fcced6413e
tree62105298aada0abe663cf21269e5dc2b65903688
parentaf5799f3056b0eee61fc09587633500a3690e67e
gh-131421: fix ASDL grammar for `Dict` to have an `expr?*` keys field (#131419)

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*`.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Parser/Python.asdl
Parser/asdl.py
Python/Python-ast.c