Message406292
I think this is correct because if you add a comma, indeed is valid syntax:
>>> sum,[i for i in [1, 2, 3] if i%2==0]
(<built-in function sum>, [2])
Here the problem is that you are mentally mapping the construct to sum(...) where the parens are substituted with brackets, which is not what the parser sees, the parser sees two expressions glued together like
>> f() g()
File "<stdin>", line 1
f() g()
^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
and it surrounds the whole expression.
Do you have an idea on what you would prefer here? Otherwise, I suggest to close as "not a bug". |
|
Date |
User |
Action |
Args |
2021-11-13 20:00:21 | pablogsal | set | recipients:
+ pablogsal, aroberge, lys.nikolaou |
2021-11-13 20:00:21 | pablogsal | set | messageid: <1636833621.54.0.493713798186.issue45801@roundup.psfhosted.org> |
2021-11-13 20:00:21 | pablogsal | link | issue45801 messages |
2021-11-13 20:00:21 | pablogsal | create | |
|