Re: best cumulative sum




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


<bonono@xxxxxxxxx> wrote in message
news:1132708265.941224.186550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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


.



Relevant Pages

  • Re: bad generator performance
    ... > recursion in the generator version. ... > overhead for closure-maintenance overhead. ... i am aware that my generator version is also recursive. ... i loved the generator solution because it was short, concise and lazy, ...
    (comp.lang.python)
  • Re: Towers of Hanoi
    ... the way won't help you with the recursion. ... changing the base case to 0 might make it more concise or ... elegant. ... Prev by Date: ...
    (comp.lang.scheme)
  • Re: Book advice:Deitel & Deitel
    ... Personally I think I'm a stong technical reader so I much prefer concise ... and exacting text. ... Mike ... Prev by Date: ...
    (comp.lang.c)
  • Re: simple list (cons) editing
    ... | It's hard to see how much more concise than ... of getting closer to the truth. ... -- C.P. Snow ... Prev by Date: ...
    (comp.lang.lisp)
  • Re: Head protection - the case against
    ... concise and informative information on the website ... Reading that will be the fastest way of ... Rather than wasting your time on this thread, go and read what you've been ... Prev by Date: ...
    (uk.rec.cycling)