Linter must deceive you. Because the right way to manage your context is with a context manager .
with LockGuard():
Put information on how to get and release the lock in LockGuard.__enter__and, LockGuard.__exit__respectively.
__init__ __del__ , __del__ .
, ++ , , Python ? .
Python . , , . , (.. locker ), , , , , __del__ .