[Python-ideas] Proposal: A Reduce-Map Comprehension and a "last" builtin

Peter O'Connor peter.ed.oconnor at gmail.com
Fri Apr 6 10:58:10 EDT 2018


Ah, ok, I suppose that could easily lead to typo-bugs.  Ok, then I agree
that "a:=f()" returning a is better

On Fri, Apr 6, 2018 at 10:53 AM, Eric Fahlgren <ericfahlgren at gmail.com>
wrote:

> On Fri, Apr 6, 2018 at 7:47 AM, Peter O'Connor <peter.ed.oconnor at gmail.com
> > wrote:
>
>> 3) The idea that an assignment operation "a = f()" returns a value (a) is
>> already consistent with the "chained assignment" syntax of "b=a=f()" (which
>> can be thought of as "b=(a=f())").  I don't know why we feel the need for
>> new constructs like "(a:=f())" or "(f() as a)" when we could just think of
>> assignments as returning values (unless that breaks something that I'm not
>> aware of)
>>
>
> ​Consider
>
> >>> if x = 1:
> >>>     print("What did I just do?")​
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180406/b2aaf926/attachment.html>


More information about the Python-ideas mailing list