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

Guido van Rossum guido at python.org
Fri Apr 6 11:06:45 EDT 2018


On Fri, Apr 6, 2018 at 7:47 AM, Peter O'Connor <peter.ed.oconnor at gmail.com>
wrote:

> Hi all, thank you for the feedback.  I laughed, I cried, and I learned.
>

You'll be a language designer yet. :-)


> However, it looks like I'd be fighting a raging current if I were to try
> and push this proposal.  It's also encouraging that most of the work would
> be done anyway if ("Statement Local Name Bindings") thread passes.  So some
> more humble proposals would be:
>
> 1) An initializer to itertools.accumulate
> functools.reduce already has an initializer, I can't see any controversy
> to adding an initializer to itertools.accumulate
>

See if that's accepted in the bug tracker.


> 2) Assignment returns a value (basically what's already in the "Statement
> local name bindings" discussion)
> `a=f()` returns a value of a
> This would allow updating variables in a generator (I don't see the need
> for ":=" or "f() as a") but that's another discussion
>

Please join the PEP 572 discussion. The strongest contender currently is `a
:= f()` and for good reasons.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180406/44342bba/attachment.html>


More information about the Python-ideas mailing list