bpo-40334: Produce better error messages for non-parenthesized genexps#20153
bpo-40334: Produce better error messages for non-parenthesized genexps#20153pablogsal merged 5 commits into
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: |
Sorry, something went wrong.
Fixed in ed64876. |
Sorry, something went wrong.
|
@pablogsal Would you be able to give this another review? |
Sorry, something went wrong.
Absolutely, will try to review this tonight :) |
Sorry, something went wrong.
No rush, whenever you find the time. |
Sorry, something went wrong.
|
LGTM I have been playing with some edge cases and it behaves as expected 🎉 |
Sorry, something went wrong.
|
Thanks @lysnikolaou for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Sorry, something went wrong.
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>
|
Thanks thanks! |
Sorry, something went wrong.
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