Skip to content

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)

@Demonstrandum
Copy link
Contributor Author

any way I can help getting this done?

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@serhiy-storchaka serhiy-storchaka merged commit f37f57d into python:main Dec 29, 2025
45 checks passed
@miss-islington-app
Copy link

Thanks @Demonstrandum for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 29, 2025
…*` (pythonGH-133773)

Also fix docs ASDL highlighting.
(cherry picked from commit f37f57d)

Co-authored-by: Samuel <samuel@knutsen.co>
@bedevere-app
Copy link

bedevere-app bot commented Dec 29, 2025

GH-143269 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Dec 29, 2025
serhiy-storchaka pushed a commit that referenced this pull request Dec 29, 2025
…?*` (GH-133773) (GH-143269)

Also fix docs ASDL highlighting.
(cherry picked from commit f37f57d)

Co-authored-by: Samuel <samuel@knutsen.co>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Arch Linux Usan Function 3.14 (no tier) has failed when building commit 6583951.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1702/builds/188) and take a look at the build logs.
  4. Check if the failure is related to this commit (6583951) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1702/builds/188

Failed tests:

  • test_urllib2net

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 23, done.        
remote: Counting objects:   5% (1/18)        
remote: Counting objects:  11% (2/18)        
remote: Counting objects:  16% (3/18)        
remote: Counting objects:  22% (4/18)        
remote: Counting objects:  27% (5/18)        
remote: Counting objects:  33% (6/18)        
remote: Counting objects:  38% (7/18)        
remote: Counting objects:  44% (8/18)        
remote: Counting objects:  50% (9/18)        
remote: Counting objects:  55% (10/18)        
remote: Counting objects:  61% (11/18)        
remote: Counting objects:  66% (12/18)        
remote: Counting objects:  72% (13/18)        
remote: Counting objects:  77% (14/18)        
remote: Counting objects:  83% (15/18)        
remote: Counting objects:  88% (16/18)        
remote: Counting objects:  94% (17/18)        
remote: Counting objects: 100% (18/18)        
remote: Counting objects: 100% (18/18), done.        
remote: Compressing objects:  20% (1/5)        
remote: Compressing objects:  40% (2/5)        
remote: Compressing objects:  60% (3/5)        
remote: Compressing objects:  80% (4/5)        
remote: Compressing objects: 100% (5/5)        
remote: Compressing objects: 100% (5/5), done.        
remote: Total 23 (delta 13), reused 13 (delta 13), pack-reused 5 (from 3)        
From https://github.com/python/cpython
 * branch                    3.14       -> FETCH_HEAD
Note: switching to '6583951e7de5e56fe1d857afebb31f804ebe8fda'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 6583951e7de [3.14] gh-131421: Fix ASDL kw_defaults being `expr*` instead of `expr?*` (GH-133773) (GH-143269)
Switched to and reset branch '3.14'

make: *** [Makefile:2496: buildbottest] Error 2

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.

4 participants