simple statement equivalent shown earlier may be difficult to justifyexcept on stylistic grounds on the other handtrading four lines for one may to many seem fairly compelling stylistic groundsgenerators are single-iteration objects subtle but important pointboth generator functions and generator expressions are their own iterators and thus support just one active iteration--unlike some built-in typesyou can' have multiple iterators of either positioned at different locations in the set of results because of thisa generator' iterator is the generator itselfin factas suggested earliercalling iter on generator expression or function is an optional noopg ( for in 'spam'iter(gis true my iterator is myselfg has __next__ if you iterate over the results stream manually with multiple iteratorsthey will all point to the same positiong ( for in 'spam' iter(gnext( 'ssssnext( 'ppppi iter(gnext( 'aaaamake new generator iterate manually second iterator at same positionmoreoveronce any iteration runs to completionall are exhausted--we have to make new generator to start againlist( ['mmmm'next( stopiteration collect the rest of ' items iter(gnext( stopiteration ditto for new iterators iter( for in 'spam'next( 'ssssnew generator to start over other iterators exhausted too the same holds true for generator functions--the following def statement-based equivalent supports just one active iterator and is exhausted after one passdef timesfour( )for in syield comprehensions and generations