On Sun, May 08, 2022 at 03:59:07PM +0100, MRAB wrote:

> >     # Currently a syntax error.
> >     results = (1, 2, (a, b) := (3, 4), 5)
> >
> Doesn't ':=' have a lower precedence than ',', so you're effectively 
> asking it to bind:
> 
>     (1, 2, (a, b))
> 
> to:
> 
>     ((3, 4), 5)

Possibly. Insert additional parentheses as needed to make it work :-)

    results = (1, 2, ((a, b) := (3, 4)), 5)


-- 
Steve
_______________________________________________
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/SLMS6N7Y6GGS7ACNWOD77QA5D5WMJZCT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to