◐ Shell
clean mode source ↗

[3.9] bpo-40334: Produce better error messages for non-parenthesized genexps (GH-20153) by miss-islington · Pull Request #20307 · python/cpython

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

https://bugs.python.org/issue40334