A generator object in python is something like a lazy list. Elements are only evaluated as soon as you iterate over them. (So the calling list evaluates them all.)
For example you can do:
>>> def f(x): ... print "yay!" ... return 2 * x >>> g = (f(i) for i in xrange(3)) # generator comprehension syntax >>> g <generator object <genexpr> at 0x37b6c0> >>> for j in g: print j ... yay! 0 yay! 2 yay! 4See how f is evaluated only as you iterate over it. You can find excellent material on the subject here: http://www.dabeaz.com/generators/