Message378305
On Python 3.9.0 with the new PEG parser, the following statement produces a SyntaxError:
with contextlib.nullcontext(range(1, 5)) as (first, *rest, last):
print(first, rest, last)
On 3.8.x, or 3.9.0 with -X oldparser, it succeeds and prints "1 [2, 3] 4" as expected.
As I understand it, the thing after 'as' is an assignment target and should accept anything that can go on the LHS of an equals sign. |
|
Date |
User |
Action |
Args |
2020-10-09 06:56:54 | Joshua Oreman | set | recipients:
+ Joshua Oreman |
2020-10-09 06:56:54 | Joshua Oreman | set | messageid: <1602226614.34.0.867074819586.issue41979@roundup.psfhosted.org> |
2020-10-09 06:56:54 | Joshua Oreman | link | issue41979 messages |
2020-10-09 06:56:54 | Joshua Oreman | create | |
|