Louis Steinberg wrote:

I have run into what seems to be a major bug, but given my short exposure to Python is probably just a feature:


Yes, it works as advertised :-/


which I would expect. Can anyone explain this or give me a workaround?

like this?


def p(d):
    print d


l=[ ]
for k in [1,2,3]:
    l.append(lambda k=k: p(k))

for f in l:
    f()
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to