self do_cleanup, , , , , .
atexit.unregister() , , , , , , . , :
class Foo:
def cleanup(self):
def start(self):
self._cleanup = self.cleanup
atexit.register(self._cleanup)
def end(self):
atexit.unregister(self._cleanup)
, atexit, , ctrl + break SIGABRT Linux.
, __del__, , , , .
, , , Python 2.x. , , - .