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 Joshua Oreman
Recipients Joshua Oreman
Date 2020-10-09.06:56:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602226614.34.0.867074819586.issue41979@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-10-09 06:56:54Joshua Oremansetrecipients: + Joshua Oreman
2020-10-09 06:56:54Joshua Oremansetmessageid: <1602226614.34.0.867074819586.issue41979@roundup.psfhosted.org>
2020-10-09 06:56:54Joshua Oremanlinkissue41979 messages
2020-10-09 06:56:54Joshua Oremancreate