Diez B. Roggisch
deets_noospaam at web.de
Sun Jul 27 18:24:21 CEST 2003
I expirienced strange problems when using the module threading:
def __init__(_, arg):
_.arg = arg
b = Bar(arg)
for i in xrange(4):
thread = threading.Thread(target=lambda : foo(i))
What I'd expect would be a sequence of prints like this
What I actualy get is this:
Placing a time.sleep(3) after the thread.start() fixed things. So it appears
that the curried lambda passed as target is somehow a reference equal for
all four invocations.
The used python is 2.2.<latest-cygwin>.
More information about the Python-list