bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400)

This commit is contained in:
Serhiy Storchaka 2017-11-15 17:39:37 +02:00 committed by GitHub
parent edad8eebee
commit ddbce13786
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 7 deletions

View file

@ -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