bpo-40334: Spacialized error message for invalid args after bare '*'#19865
Merged
pablogsal merged 2 commits intopython:masterfrom May 4, 2020
Merged
bpo-40334: Spacialized error message for invalid args after bare '*'#19865pablogsal merged 2 commits intopython:masterfrom
pablogsal merged 2 commits intopython:masterfrom
Conversation
When parsing things like `def f(*): pass` the old parser used to output `SyntaxError: named arguments must follow bare *`, which the new parser wasn't able to do.
gvanrossum
approved these changes
May 2, 2020
Member
|
Okay, good as-is.
On Sat, May 2, 2020 at 14:10 Lysandros Nikolaou ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Grammar/python.gram
<#19865 (comment)>:
> +invalid_star_etc:
+ | '*' (')' | ',' (')' | '**')) { RAISE_SYNTAX_ERROR("named arguments must follow bare *") }
+invalid_lambda_star_etc:
+ | '*' (':' | ',' (':' | '**')) { RAISE_SYNTAX_ERROR("named arguments must follow bare *") }
Or would that be too weird?
Your call. IMHO it'd be a bit more difficult to understand a rule like
that. "What's the colon doing there?"
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#19865 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWCWMTWMXUGRVJ5MSXVSETRPSD2XANCNFSM4MXZI7PA>
.
--
--Guido (mobile)
|
pablogsal
approved these changes
May 4, 2020
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When parsing things like
def f(*): passorlambda *: passthe old parser used tooutput
SyntaxError: named arguments must follow bare *, which thenew parser wasn't able to do.
https://bugs.python.org/issue40334