mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +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
|
@ -638,10 +638,14 @@ Changes in Python behavior
|
|||
|
||||
f(1 for x in [1],)
|
||||
|
||||
class C(1 for x in [1]):
|
||||
pass
|
||||
|
||||
Python 3.7 now correctly raises a :exc:`SyntaxError`, as a generator
|
||||
expression always needs to be directly inside a set of parentheses
|
||||
and cannot have a comma on either side.
|
||||
(Contributed by Serhiy Storchaka in :issue:`32012`.)
|
||||
and cannot have a comma on either side, and the duplication of the
|
||||
parentheses can be omitted only on calls.
|
||||
(Contributed by Serhiy Storchaka in :issue:`32012` and :issue:`32023`.)
|
||||
|
||||
|
||||
Changes in the Python API
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue