Skip to content

gh-131421: Fix ASDL kw_defaults being expr* instead of expr?* (+ fix docs ASDL highlighting) #133773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Demonstrandum
Copy link
Contributor

@Demonstrandum Demonstrandum commented May 9, 2025

According to the docs:

(https://docs.python.org/3.15/library/ast.html#ast.arguments)
kw_defaults is a list of default values for keyword-only arguments. If one is None, the corresponding argument is required.

However, ASDL's description of kw_defaults is that it simply a expr*, and not a expr?* as stated by the docs.

This continues the same correction for expr Dict in the ASDL in PR #131419.


I also corrected the syntax highlighting regex to support the chained qualifiers syntax introduced to the ASDL.

before after
Screenshot 2025-05-09 at 16 17 13 Screenshot 2025-05-09 at 16 21 14

📚 Documentation preview 📚: https://cpython-previews--133773.org.readthedocs.build/

…kw_defaults`

According to the docs:

> (https://docs.python.org/3.15/library/ast.html#ast.arguments)
> kw_defaults is a list of default values for keyword-only arguments. If one is None, the corresponding argument is required.

However, ASDL's description of `kw_defaults` is that it simply a
`expr*`, and not a `expr?*` as stated by the docs.
@picnixz
Copy link
Member

picnixz commented May 9, 2025

We'll just backport this to 3.14 (it'd be really weird to have the first part in 3.14 but not this one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants