jena wrote:
> hello,
> when i create list of lambdas:
> l=[lambda:x.upper() for x in ['a','b','c']]
> then l[0]() returns 'C', i think, it should be 'A'

Fredrik Lundh provided the general solution, but in this specific case,
the simplest solution is:

l = [x.upper for x in ['a', 'b', 'c']]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to