mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400)
This commit is contained in:
parent
edad8eebee
commit
ddbce13786
4 changed files with 23 additions and 7 deletions
|
@ -153,6 +153,10 @@ Traceback (most recent call last):
|
|||
SyntaxError: Generator expression must be parenthesized
|
||||
>>> f((x for x in L), 1)
|
||||
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
>>> class C(x for x in L):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: invalid syntax
|
||||
|
||||
>>> def g(*args, **kwargs):
|
||||
... print(args, sorted(kwargs.items()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue