Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66354 > unrolled thread

Re: Generator using item[n-1] + item[n] memory

Started byNick Timkovich <prometheus235@gmail.com>
First post2014-02-14 20:57 -0600
Last post2014-02-14 20:57 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Re: Generator using item[n-1] + item[n] memory Nick Timkovich <prometheus235@gmail.com> - 2014-02-14 20:57 -0600

#66354 — Re: Generator using item[n-1] + item[n] memory

FromNick Timkovich <prometheus235@gmail.com>
Date2014-02-14 20:57 -0600
SubjectRe: Generator using item[n-1] + item[n] memory
Message-ID<mailman.6952.1392433921.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

Ah, I think I was equating `yield` too closely with `return` in my head.
 Whereas `return` results in the destruction of the function's locals,
`yield` I should have known keeps them around, a la C's `static` functions.
 Many thanks!

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web