best cumulative sum

David Isaac aisaac0 at verizon.net
Sun Nov 27 13:48:56 EST 2005


"Peter Otten" <__peter__ at web.de> wrote in message
news:dm95or$dkt$03$1 at news.t-online.com...
> I think that the test for an empty iterator makes ireduce() unintuitive.

OK.
I misunderstood you point.
But that is needed to match the behavior of reduce.
>>> reduce(operator.add,[],42)
42

Thanks,
Alan





More information about the Python-list mailing list