On Sun, 8 May 2022 at 20:52, Steven D'Aprano <st...@pearwood.info> wrote:
> Just a quick straw poll, how would people feel about relaxing the
> restriction on the walrus operator so that iterable unpacking is
> allowed?
>
>     # Currently a syntax error.
>     results = (1, 2, (a, b) := (3, 4), 5)
>
> which would create the following bindings:
>
>     results = (1, 2, (3, 4), 5)
>     a = 3
>     b = 4

I've always thought of relaxing the restrictions. It's actually easy to 
implement (even including attribute assignment/subscript assignment) and I had 
to modify only two files (plus regenerate the parser).
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/7LVZLFS4PVJDJF43SVLGCXODDG6BEYLW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to