[Python-Dev] PEP 289: Generator Expressions (second draft)

Guido van Rossum guido at python.org
Wed Oct 22 11:07:50 EDT 2003


> I probably missed it in this monster of a thread, but how do
> generator expressions do this?  It seems that they'd only make
> reduce more efficient, but it would still be just as needed as
> before.

All we need is more standard accumulator functions like sum().  There
are many useful accumulator functions that aren't easily expressed as
a binary operator but are easily done with an explicit iterator
argument, so I am hopeful that the need for reduce will disappear.
99% use cases for reduce were with operator.add, and that's replaced
by sum() already.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list