Re: best cumulative sum



"Peter Otten" <__peter__@xxxxxx> wrote in message
news:dm95or$dkt$03$1@xxxxxxxxxxxxxxxxxxxx
> 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


.



Relevant Pages

  • Re: best cumulative sum
    ... >> I think that the test for an empty iterator makes ireduce() unintuitive. ... > I misunderstood you point. ...
    (comp.lang.python)
  • scanl in python
    ... >I think that the test for an empty iterator makes ireduce() unintuitive. ... Haskell), it is: ... Prev by Date: ...
    (comp.lang.python)