jena <[EMAIL PROTECTED]> writes:
> l=[lambda:x.upper() for x in ['a','b','c']]
> then l[0]() returns 'C', i think, it should be 'A'

Yeah, this is Python late binding, a standard thing to get confused
over.  You want:

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

Reply via email to