copying generatrors

Matimus mccredie at gmail.com
Wed Jun 6 01:50:23 CEST 2007


Why not just do this:

>>> def foo():
...  yield 1
...  yield 2
...  yield 3
...
>>> f = foo()
>>> g = foo()
>>> f.next()
1
>>> f.next()
2
>>> f.next()
3
>>> g.next()
1
>>> g.next()
2
>>> g.next()
3




More information about the Python-list mailing list