reduce()--what is it good for? (was: Re: reduce() anomaly?)

Alex Martelli aleaxit at yahoo.com
Wed Nov 5 18:16:25 EST 2003


Francis Avila wrote:
   ...
> Just out of curiosity, for what kind of problems do we find reduce to just
> be the Right Way?  I mean, summing a big list of numbers is fun and all,

And best handled by sum (in Python 2.3).

> reduce--the black sheep of the functional-Python herd?

Nope -- apply beats it, given that in the last few years apply(f, args) is
best spelled f(*args) ...!-)


Alex





More information about the Python-list mailing list