Skip to content

gh-140253: Improve the syntax error from an ill-positioned double-star subpattern#140254

Merged
Eclips4 merged 8 commits into
python:mainfrom
johnslavik:invalid-double-star-mapping
Oct 22, 2025
Merged

gh-140253: Improve the syntax error from an ill-positioned double-star subpattern#140254
Eclips4 merged 8 commits into
python:mainfrom
johnslavik:invalid-double-star-mapping

Conversation

@johnslavik

@johnslavik johnslavik commented Oct 17, 2025

Copy link
Copy Markdown
Member

Comment thread Lib/test/test_exceptions.py
Comment thread Lib/test/test_syntax.py
@johnslavik

Copy link
Copy Markdown
Member Author

Extra notes: I've considered including ** in the offset, but it's harder to achieve and it didn't really bring that much value -- it's already obvious from the message that it's the whole double-star pattern that is wrongly placed. I believe grammar file changes should be as simple as possible.

Comment thread Grammar/python.gram Outdated
@johnslavik johnslavik marked this pull request as draft October 17, 2025 13:48
@johnslavik johnslavik marked this pull request as ready for review October 17, 2025 13:52
Comment thread Lib/test/test_syntax.py
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@johnslavik johnslavik requested a review from Eclips4 October 18, 2025 23:41

@Eclips4 Eclips4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! LGTM. Let’s wait a couple of days to see if anyone else has something to add.

@Eclips4 Eclips4 merged commit b3b0d75 into python:main Oct 22, 2025
49 checks passed
@bedevere-bot

Copy link
Copy Markdown

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

Hi! The buildbot iOS ARM64 Simulator 3.x (tier-3) has failed when building commit b3b0d75.

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/1380/builds/4917) and take a look at the build logs.
  4. Check if the failure is related to this commit (b3b0d75) 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/1380/builds/4917

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

Click to see traceback logs
remote: Enumerating objects: 15, done.        
remote: Counting objects:   7% (1/13)        
remote: Counting objects:  15% (2/13)        
remote: Counting objects:  23% (3/13)        
remote: Counting objects:  30% (4/13)        
remote: Counting objects:  38% (5/13)        
remote: Counting objects:  46% (6/13)        
remote: Counting objects:  53% (7/13)        
remote: Counting objects:  61% (8/13)        
remote: Counting objects:  69% (9/13)        
remote: Counting objects:  76% (10/13)        
remote: Counting objects:  84% (11/13)        
remote: Counting objects:  92% (12/13)        
remote: Counting objects: 100% (13/13)        
remote: Counting objects: 100% (13/13), done.        
remote: Compressing objects:   8% (1/12)        
remote: Compressing objects:  16% (2/12)        
remote: Compressing objects:  25% (3/12)        
remote: Compressing objects:  33% (4/12)        
remote: Compressing objects:  41% (5/12)        
remote: Compressing objects:  50% (6/12)        
remote: Compressing objects:  58% (7/12)        
remote: Compressing objects:  66% (8/12)        
remote: Compressing objects:  75% (9/12)        
remote: Compressing objects:  83% (10/12)        
remote: Compressing objects:  91% (11/12)        
remote: Compressing objects: 100% (12/12)        
remote: Compressing objects: 100% (12/12), done.        
remote: Total 15 (delta 1), reused 1 (delta 1), pack-reused 2 (from 1)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to 'b3b0d750697e931e46b004122bde7b7987769a87'.

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 b3b0d750697 gh-140253: Improve the syntax error from an ill-positioned double-star subpattern (#140254)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

ld: warning: ignoring duplicate libraries: '-lm'
ld: warning: ignoring duplicate libraries: '-lm'

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:4A7F2ACB-DEB3-48C5-83AB-082A7477C83B, OS:18.2, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:4A7F2ACB-DEB3-48C5-83AB-082A7477C83B, OS:18.2, name:iPhone SE (3rd generation) }
make: *** [testios] Terminated: 15

@johnslavik

Copy link
Copy Markdown
Member Author

Doesn't look like the buildbot failure is related.

@johnslavik johnslavik deleted the invalid-double-star-mapping branch December 2, 2025 00:44
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants