Author svenrahmann
Recipients svenrahmann
Date 2009-05-08.13:24:48
SpamBayes Score 3.31617e-06
Marked as misclassified No
Message-id <>
Lists from list comprehensions and generator objects from generator
expressions behave differently when we repeatedly want to iterate over them.

This may or may not be a bug, but it is certainly not clear from the
documentation (see documentation of "for" statement in all recent python

The reason seems to be that generator expressions, once exhausted, are
not reset by using them again in a for loop.
This is different for lists and range objects.

The attached example illustrates the phenomenon.
It is written for Python 3, but the same phenomenon occurs in the 2.x
Date User Action Args
2009-05-08 13:24:50svenrahmannsetrecipients: + svenrahmann
2009-05-08 13:24:50svenrahmannsetmessageid: <>
2009-05-08 13:24:49svenrahmannlinkissue5968 messages
2009-05-08 13:24:49svenrahmanncreate