'Cancel finalization of the object'

def cancel(self):

    try:
        del _finalizer_registry[self._key]
    except KeyError:
        pass
    else:
        self._weakref = self._callback = self._args = self._kwargs = self._key = None
