◐ Shell
clean mode source ↗

bpo-40334: Produce better error messages for non-parenthesized genexps by lysnikolaou · Pull Request #20153 · python/cpython

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.

pablogsal

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 22, 2020
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>

miss-islington added a commit that referenced this pull request

May 22, 2020
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>

arturoescaip pushed a commit to arturoescaip/cpython that referenced this pull request

May 24, 2020
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.