Skip to content

Files

Latest commit

 

History

History
20 lines (13 loc) · 418 Bytes

bad-thread-instantiation.md

File metadata and controls

20 lines (13 loc) · 418 Bytes

Pattern: Bad thread instantiation

Issue: -

Description

Emitted when the threading.Thread class does not receive the target argument, but receives just one argument, which is by default the group parameter.

Example of incorrect code:

import threading
threading.Thread(lambda: print(1)) #this is the group parameter

Example of correct code:

threading.Thread(target=worker)