Author Joshua Oreman
Recipients Joshua Oreman
Date 2020-10-09.06:56:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:54Joshua Oremansetrecipients: + Joshua Oreman
2020-10-09 06:56:54Joshua Oremansetmessageid: <>
2020-10-09 06:56:54Joshua Oremanlinkissue41979 messages
2020-10-09 06:56:54Joshua Oremancreate