subtle side effect of generator/generator expression

Simon Percivall percivall at gmail.com
Sun Oct 16 11:38:38 EDT 2005


If you find that you want to iterate over an iterable multiple times,
have a look at the solution that the tee() function in the itertools
module provides (http://docs.python.org/lib/itertools-functions.html).
(Have a look at the rest of the itertools module as well, for that
matter.)




More information about the Python-list mailing list