[Python-3000] map, filter, reduce

Georg Brandl g.brandl at gmx.net
Fri Jun 1 21:17:35 CEST 2007


Terry Reedy schrieb:
> "Jason Orendorff" <jason.orendorff at gmail.com> wrote in message 
> news:bb8868b90706010905p2dae12b7qc538cf25190c7127 at mail.gmail.com...
> | PEP 3100 still isn't clear on the fate of these guys, except that
> | reduce() is gone.
> |
> | How about moving all three to the functools module instead?
> 
> The current reduce is broken due to being a mashing together of two 
> versions of the function (one 2 params, the other 3), with the 3-param one 
> having an ill-formed signature (inconsistent parameter order) to allow the 
> mashing that should not have been done.  (The ill-formed signature is hard 
> to remember and is responsible for part of some peoples' dislike of 
> reduce.) I would like a proper 3-param version in functools, but have not 
> writen the exact proposal yet since library changes have been put off.
> 
> I am also thinking about an ireduce, but need to make sure it cannot be 
> easily done with current itertools.

How should an "ireduce" work? The result is not a sequence which could be
returned lazily.

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-3000 mailing list