This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aroberge
Recipients aroberge, lys.nikolaou, pablogsal
Date 2021-11-13.17:00:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1636822806.1.0.227872215707.issue45801@roundup.psfhosted.org>
In-reply-to
Content
Python 3.10 and 3.11:

>>> sum[i for i in [1, 2, 3] if i%2==0]
  File "<stdin>", line 1
    sum[i for i in [1, 2, 3] if i%2==0]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Furthermore, I don't find that highlighting the entire statement (or parts of it, if we use print(sum[...]) is very useful in attempting to find the source of the error.

In previous versions, we would get the following:

>>> sum[i for i in [1, 2, 3] if i%2==0]
  File "<stdin>", line 1
    sum[i for i in [1, 2, 3] if i%2==0]
          ^
SyntaxError: invalid syntax
History
Date User Action Args
2021-11-13 17:00:06arobergesetrecipients: + aroberge, lys.nikolaou, pablogsal
2021-11-13 17:00:06arobergesetmessageid: <1636822806.1.0.227872215707.issue45801@roundup.psfhosted.org>
2021-11-13 17:00:06arobergelinkissue45801 messages
2021-11-13 17:00:05arobergecreate