-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-40334: Produce better error messages for non-parenthesized genexps #20153
Conversation
The error message, generated for non-parenthesized generator expression in function calls, was still the generic `invalid syntax`, when the generator expression wasn't appearing as the first argument in the call. Now, even on input like `f(a, b, c for c in d, e)`, the correct error message gets produced.
Humm, there are still some mistmatches. For instance:
with the old parser:
|
Fixed in ed64876. |
@pablogsal Would you be able to give this another review? |
Absolutely, will try to review this tonight :) |
No rush, whenever you find the time. |
LGTM I have been playing with some edge cases and it behaves as expected 🎉 |
Thanks @lysnikolaou for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
pythonGH-20153) The error message, generated for a non-parenthesized generator expression in function calls, was still the generic `invalid syntax`, when the generator expression wasn't appearing as the first argument in the call. With this patch, even on input like `f(a, b, c for c in d, e)`, the correct error message gets produced. (cherry picked from commit ae14583) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
GH-20307 is a backport of this pull request to the 3.9 branch. |
Thanks thanks! |
GH-20153) The error message, generated for a non-parenthesized generator expression in function calls, was still the generic `invalid syntax`, when the generator expression wasn't appearing as the first argument in the call. With this patch, even on input like `f(a, b, c for c in d, e)`, the correct error message gets produced. (cherry picked from commit ae14583) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
pythonGH-20153) The error message, generated for a non-parenthesized generator expression in function calls, was still the generic `invalid syntax`, when the generator expression wasn't appearing as the first argument in the call. With this patch, even on input like `f(a, b, c for c in d, e)`, the correct error message gets produced.
The error message, generated for non-parenthesized generator expression
in function calls, was still the generic
invalid syntax
, when thegenerator expression wasn't appearing as the first argument in the call.
Now, even on inputs like
f(a, b, c for c in d, e)
, the correct errormessage gets produced.
PS Last one with this bpo number. Promise!
https://bugs.python.org/issue40334