-
-
Couldn't load subscription status.
- Fork 33.2k
gh-140253: Improve the syntax error from an ill-positioned double-star subpattern #140254
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
Conversation
| check(dedent("""\ | ||
| match ...: | ||
| case {**rest1, "after": after}: | ||
| ... | ||
| """), 2, 11) | ||
| check(dedent("""\ | ||
| match ...: | ||
| case {"before": before, **rest2, "after": after}: | ||
| ... | ||
| """), 2, 29) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
|
Extra notes: I've considered including |
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
There was a problem hiding this 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.
|
|
Doesn't look like the buildbot failure is related. |
Uh oh!
There was an error while loading. Please reload this page.