A question about generators

Delaney, Timothy tdelaney at avaya.com
Mon Mar 18 18:27:44 EST 2002


> I have an application where I think either an iterator or a 
> generator would
> be ideal, but I have to be able to reset whichever I use.  The paper
> "What's New in Python 2.2" says that there's no way to reset 
> an iterator,
> so that's out.  Is there a straight-forward way to reset a generator,
> though?

That's not actually correct. There is no general way to reset and iterator
or generator, but you can make a custom iterator or generator that can be
reset.

Tim Delaney




More information about the Python-list mailing list