def self(accessing_obj, accessed_obj, *args, **kwargs):
 return (accessing_obj == accessed_obj)

def self ( accessing_obj , accessed_obj , * args , ** kwargs ) : return ( accessing_obj == accessed_obj )
check if accessing_obj is the same as accessed_obj usage: self() this can be used to lock specifically only to the same object that the lock is defined on .