Skip to content

Conversation

@bswck
Copy link
Contributor

@bswck bswck commented Oct 17, 2025

Comment on lines +255 to +264
check(dedent("""\
match ...:
case {**rest1, "after": after}:
...
"""), 2, 11)
check(dedent("""\
match ...:
case {"before": before, **rest2, "after": after}:
...
"""), 2, 29)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made it multi-line with dedent so it's easier to read--these tests were missing a case where some items were placed before the double-star pattern.

Copy link
Contributor Author

@bswck bswck Oct 17, 2025

Choose a reason for hiding this comment

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

I'm using rest1 and rest2 names here so that they differ from what is in the grammar file and perhaps in other places. Just my intuition.

SyntaxError: invalid character '£' (U+00A3)
Invalid pattern matching constructs:
Invalid pattern matching constructs:
Copy link
Contributor Author

@bswck bswck Oct 17, 2025

Choose a reason for hiding this comment

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

This was likely an accidental indentation, fixed it by the way.

@bswck
Copy link
Contributor Author

bswck commented Oct 17, 2025

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.

@bswck bswck marked this pull request as draft October 17, 2025 13:48
@bswck bswck marked this pull request as ready for review October 17, 2025 13:52
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@bswck bswck requested a review from Eclips4 October 18, 2025 23:41
Copy link
Member

@Eclips4 Eclips4 left a comment

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

⚠️⚠️⚠️ 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

@bswck
Copy link
Contributor Author

bswck commented Oct 22, 2025

Doesn't look like the buildbot failure is related.

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