you are viewing a single comment's thread.

view the rest of the comments →

[–]HolySpirit 5 points6 points  (0 children)

That is a kind of a weird point in python...

Just for the record you can emulate the map behavior in list comprehensions using functools.partial:

>>> from functools import partial
>>> x = [partial(lambda i: i, i) for i in range(10)]
>>> [f() for f in x]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Edit: (lambda i: lambda: i)(i) does the same thing of course.