Generators for Engineers

A gentle introduction to infinite sequences.

Comments are moderated. It may take a few minutes before your comment appears.
Markdown is supported in your comments.

Amusing bugs caused by negative list indices aside, neither version is acceptable. Both require having the entire list in memory. They will not work on streams of data, produced in real time. It will also break if you have several gigs of historical data to crunch. A better method involves caching:

Name:
Mail: (not shown)

Please type this: