thread.start_new_thread(myfunc, "some string", 42)

This should have been

  thread.start_new_thread(myfunc, ("some string", 42))

because all the subsequent values after the function-handle/name get passed into the function when it gets called. As if the start_new_thread() function was defined as

   def start_new_thread(fn, *args, **kwargs):
     thread_magic_happens_here()
     result = fn(*args, **kwargs)
     return more_thread_magic_happens_here(result)

and this should have been

  def start_new_thread(fn, args=[], kwargs={}):
    thread_magic()
    result = fn(*args, **kwargs)

My threading-library usage is a little rusty, so I forgot those were literal parameters, not args/kwargs that became more idiomatic in other code authored later.

-tkc




--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to