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

Alex Martelli aleaxit at yahoo.com
Thu Nov 6 00:16:25 CET 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