Message390369
According to the documentation, a lambda expression at the `comp_if` position of a comprehension is allowed (can be parsed as `lambda_expr_nocond`). But this seems broken in Python 3.9 PEG parser. Example:
user@host:/$ python3.8
Python 3.8.9 (default, Apr 3 2021, 01:00:00)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> [x for x in range(10) if lambda: 1]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>>
user@host:/$ python3.9
Python 3.9.3 (default, Apr 3 2021, 00:51:37)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> [x for x in range(10) if lambda: 1]
File "<stdin>", line 1
[x for x in range(10) if lambda: 1]
^
SyntaxError: invalid syntax |
|
Date |
User |
Action |
Args |
2021-04-06 20:07:25 | gousaiyang | set | recipients:
+ gousaiyang |
2021-04-06 20:07:25 | gousaiyang | set | messageid: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> |
2021-04-06 20:07:25 | gousaiyang | link | issue43755 messages |
2021-04-06 20:07:25 | gousaiyang | create | |
|