generator object, next method

Paul Rubin http
Thu Sep 8 04:14:07 EDT 2005


Duncan Booth <duncan.booth at invalid.invalid> writes:
> 1) Every time you access gen.next you create a new method-wrapper object.

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?



More information about the Python-list mailing list