A question about generators

Greg Ewing greg at cosc.canterbury.ac.nz
Fri Mar 22 02:25:09 CET 2002


Richard J Kuhns wrote:
> 
> That's EXACTLY what I did :).  The main reason I had problems to start with
> is that almost everything I've done with python feels more-or-less
> "elegant", and this doesn't.

Well, generators weren't designed for the sort of problems
that require restartability.

Is there some reason you absolutely can't just create
a new instance of the generator each time you need
to restart? That would be the most elegant way,
if you can manage it.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list