Dangerous behavior of list(generator)
greg.ewing at canterbury.ac.nz
Sat Dec 19 06:15:18 CET 2009
Albert van der Horst wrote:
> An important feature that is not documented is a severe defect.
This isn't something that I would expect to find documented
under the heading of generator expressions, because it doesn't
have anything to do with them. It's an interaction between
the iterator protocol and the list() constructor. Any other
iterable that leaked a StopIteration exception would cause
the same effect.
More information about the Python-list