What does generator comprehension do? How does it work? I couldn\'t find a tutorial about it.
Another example of Generator comprehension:
print 'Generator comprehensions' def sq_num(n): for num in (x**2 for x in range(n)): yield num for x in sq_num(10): print x