U
Ulrich Eckhardt
Hi!
I'm looking at the 'threading' module and see that other than the 'thread'
module it doesn't have a simple function to start a new thread. Instead,
you first have to instantiate a threading object and then start the new
thread on it:
t = threading.Thread(target=my_function)
t.start()
What I'm wondering is if following function wouldn't be a good addition to
the threading module:
def start_new_thread(target, ..):
t = Thread(target, ..)
t.start()
return t
Note: I left out the additional parameters for brevity, but they should of
course be forwarded, but the 'target' parameter is not optional as it is
with Thread's constructor.
Uli
I'm looking at the 'threading' module and see that other than the 'thread'
module it doesn't have a simple function to start a new thread. Instead,
you first have to instantiate a threading object and then start the new
thread on it:
t = threading.Thread(target=my_function)
t.start()
What I'm wondering is if following function wouldn't be a good addition to
the threading module:
def start_new_thread(target, ..):
t = Thread(target, ..)
t.start()
return t
Note: I left out the additional parameters for brevity, but they should of
course be forwarded, but the 'target' parameter is not optional as it is
with Thread's constructor.
Uli