PY3.W1506
Bad thread instantiation
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.
Noncompliant Code:
Copy
import threading
def thread_target(n):
print(n ** 2)
thread = threading.Thread(thread_target, args=(10,))
thread.start()
Compliant Code:
Copy
import threading
def thread_target(n):
print(n ** 2)
thread = threading.Thread(target=thread_target, args=(10,))
thread.start()