Generator Comprehensions

Neil Schemenauer nas at python.ca
Wed Jan 30 11:35:26 EST 2002


gbreed at cix.compulink.co.uk wrote:
> >>> map(lambda x:x+1, range(10))
> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> >>> x
> Traceback (innermost last):
>   File "<interactive input>", line 1, in ?
> NameError: There is no variable named 'x'

Forget about map and lambda.  They do not have Pythonic nature.  You
can't use them to support your position.

  Neil




More information about the Python-list mailing list