> Why is that? I thought gen.next is a callable and gen.next() actually > advances the iterator. Why shouldn't gen.next always be the same object?
That is, in essence, my question. Executing the below script, rather than typing at a console, probably clarifies things a little. Sw. #------------------- def iterator(): yield None gen = iterator() #gen.next is bound to x, and therefore, gen.next should not be GC? x = gen.next y = gen.next print x print y print gen.next #------------------- -- http://mail.python.org/mailman/listinfo/python-list