How sum() should really be done

Douglas Alan nessus at mit.edu
Fri Nov 14 04:19:12 EST 2003


Erik Max Francis <max at alcyone.com> writes:

> Douglas Alan wrote:

>> Ah, that reminds me -- both sum() and reduce() can be removed from
>> Python by extending operator.add so that it will take any number of
>> arguments.

> reduce can't, since reduce doesn't require the function passed to be
> operator.add.

Well, as I said, for this to be true, *all* binary operators (that it
makes sense to) would have to be upgraded to take an arbitrary number
of arguments, like they do in Lisp.

|>oug




More information about the Python-list mailing list