[snip]
> > If you want next(g) to yield 3, you'd have to do something like:
> > 
> >     g = (x for x in s[:])
> > 
> > where s[:] makes a copy of s that is then iterated over.
 

BTW, this simpler statement works, too:

   g = iter(s[:])

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to