def function(): foo = 1 gen_expr = (foo for foo in xrange(10)) print foo #