[Python-Dev] Call for prudence about PEP-572

Chris Angelico rosuav at gmail.com
Sun Jul 8 17:32:58 EDT 2018


On Mon, Jul 9, 2018 at 7:27 AM, Giampaolo Rodola' <g.rodola at gmail.com> wrote:
> 5) It has no keyword argument correspondence. If foo(x := 1) is
> allowed then why this one is not?
>     >>> foo(x=(x := 1))
> (I don't think it should BTW: it's not pretty)

Actually it is. Nothing wrong with that. It assigns to 'x' in the
local scope, and also passes that as a keyword parameter named 'x'.

ChrisA


More information about the Python-Dev mailing list