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.