About that 'yield' word

Michael Sparks zathras at thwackety.com
Sat Oct 4 15:28:11 EDT 2003


Since you're using python 2.2.X you need to have the following:

from __future__ import generators

def maker():
   for i in range(100):
      yield i

In Python 2.3 you don't need that import from __future__.


Michael.






More information about the Python-list mailing list