Derived from the Pylint linter.
This rule is unstable and in preview. The
--preview flag is required for use.
What it does#
Checks for direct uses of lock objects in
Why is this bad?#
Creating a lock (via
threading.Lock or similar) in a
has no effect, as locks are only relevant when shared between threads.
Instead, assign the lock to a variable outside the
and share that variable between threads.