[Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

Kirill Balunov kirillbalunov at gmail.com
Mon Mar 26 07:42:32 EDT 2018


2018-03-26 14:18 GMT+03:00 Steven D'Aprano <steve at pearwood.info>:

> That was probably my response to Nick:
>
> https://mail.python.org/pipermail/python-ideas/2018-March/049472.html
>
> I compared four possible choices:
>
>     target = default if (expression as name) is None else name
>     target = default if (name := expression) is None else name
>     target = default if (expression -> name) is None else name
>     target = default if (name <- expression) is None else name
>

Yes, most likely :)


>
> The two arrow assignment operators <- and -> are both taken from R.
>
>
I was also thinking about `<-` variant (but with a Haskell in mind), but
with the current Python rules, it seems that it does not fit:

>>> x = 10
>>> (x <- 5)
False

With kind regards,
-gdg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180326/8e6297ec/attachment-0001.html>


More information about the Python-ideas mailing list