mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-32012: Disallow trailing comma after genexpr without parenthesis. (#4382)
This commit is contained in:
parent
3bda02222a
commit
9165f77d5f
4 changed files with 45 additions and 13 deletions
|
@ -630,6 +630,20 @@ This section lists previously described changes and other bugfixes
|
|||
that may require changes to your code.
|
||||
|
||||
|
||||
Changes in Python behavior
|
||||
--------------------------
|
||||
|
||||
* Due to an oversight, earlier Python versions erroneously accepted the
|
||||
following syntax::
|
||||
|
||||
f(1 for x in [1],)
|
||||
|
||||
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`.)
|
||||
|
||||
|
||||
Changes in the Python API
|
||||
-------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue