It's common to create multiple threads, start them, and then join them. Example:
threads= [
threading.Thread(target=run_a),
threading.Thread(target=run_b),
]
forthreadinthreads:
thread.start()
...
forthreadinthreads:
thread.join()
I propose adding a start=False parameter to threading.Thread to start immediately the thread. The example would become:
threads= [
threading.Thread(target=run_a, start=True),
threading.Thread(target=run_b, start=True),
]
...
forthreadinthreads:
thread.join()
The new parameter would solve the old issue gh-93293 which requests to return self in start(). The issue example:
threads= []
foriinrange(10):
thread=threading.Thread(target=fn, args=(i,))
thread.start()
threads.append(thread)
fortinthreads:
t.join()
would become:
threads= [threading.Thread(target=fn, args=(i,), start=True) foriinrange(10)]
fortinthreads:
t.join()
Linked PRs
It's common to create multiple threads, start them, and then join them. Example:
I propose adding a start=False parameter to threading.Thread to start immediately the thread. The example would become:
The new parameter would solve the old issue gh-93293 which requests to return self in
start(). The issue example:would become:
Linked PRs