On Mon, Nov 24, 2014 at 12:23 PM, Chris Angelico rosuav@gmail.com wrote:
Well, there is probably more to be said about this - along the lines of *why* generators ought to be more like iterators. (They're iterables, not iterators.)
If generators are not iterators, how do you explain this?
import collections def g():
... yield 42 ...
isinstance(g(), collections.Iterator)
True