> This is caused by the scoping rules for Python's lambdas and list
> comprehensions.  See the question and answer here for an 
> explanation:http://stackoverflow.com/questions/139819/why-results-of-map-and-list...
>
> --Mike

...ok, so, a way to write it would be
b = [lambda x,u=i:u for i in range(2)]

Thanks for the link, that was very helpful.
-- Martin
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to