best cumulative sum

David Isaac aisaac0 at
Wed Nov 23 16:20:24 CET 2005

> Michael Spencer wrote:
> > This can be written more concisely as a generator:

<bonono at> wrote in message
news:1132708265.941224.186550 at
> If iterable has no elements, I believe the behaviour should be [init],
> there is also the case of init=None that needs to be handled.

Right.  So it is "more concise" only by being incomplete, right?
What other advantages might it have?

> otherwise, that is more or less what I wrote for my scanl/scanl1.

I didn't see a post with that code.

Alan Isaac

More information about the Python-list mailing list