[Python-ideas] Add nullifier argument to functools.reduce?

Stephen J. Turnbull stephen at xemacs.org
Tue Aug 26 03:43:42 CEST 2014


Warren Weckesser writes:

 > I don't agree that this change "significantly changes the semantics of
 > reduce".  The nullifier is optional.

Many programs deal with domains that seem to have nullifiers but don't.
See Steven's example of floating point multiplication where the "tail"
might contain Inf or NaN.  You can argue that this is a "consenting
adults" issue, but I consider this possibility an attractive nuisance,
and I'd rather it not be in the stdlib.

IMHO YMMV



More information about the Python-ideas mailing list