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.

An excellent feature of Python's generators is constant memory usage. Short generators and infinite generators are both the same size, a consequence of not storing any values the generator produces. Once a value is produced, it is thrown away. One can not look into a generator's past or future. This article is about using the limitations of generators to your advantage.

Name:
Mail: (not shown)

Please type this: