mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
[parser] Flag single unparenthesized generator expr with trailing comma in arguments. (#17893)
Fixes #17867 ## Summary The CPython parser does not allow generator expressions which are the sole arguments in an argument list to have a trailing comma. With this change, we start flagging such instances. ## Test Plan Added new inline tests.
This commit is contained in:
parent
895b6161a6
commit
f5096f2050
6 changed files with 426 additions and 124 deletions
|
@ -1,2 +1,3 @@
|
|||
sum(x for x in range(10), 5)
|
||||
total(1, 2, x for x in range(5), 6)
|
||||
sum(x for x in range(10),)
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
zip((x for x in range(10)), (y for y in range(10)))
|
||||
sum(x for x in range(10))
|
||||
sum((x for x in range(10)),)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue