import threading
def thread_target(n):
print(n ** 2)
thread = threading.Thread(thread_target, args=(10,))
thread.start()
import threading
def thread_target(n):
print(n ** 2)
thread = threading.Thread(target=thread_target, args=(10,))
thread.start()
The warning is emitted when a threading.Thread
class is instantiated without
the target function being passed. By default, the first parameter is the
group
param, not the target
param.