In Python 3.x all classes are subclasses of object
. In 2.x you have to explicitly state class MyClass(object)
. And, as I'm trying to write as much 3.x compatible code as possible, I'm subclassing object
.
In my program, I'm using the __del__
method, and I wanted to know if I should be calling object.__del__(self)
, or if that's magically taken care of?
Thanks, Wayne
EDIT: It appears there is some confusion what I mean - in the documents it states:
If a base class has a
__del__()
method, the derived class’s__del__()
method, if any, must explicitly call it to ensure proper deletion of the base class part of the instance.
So I wanted to know if I needed:
def __del__(self):
object.__del__(self)
or some suitable alternative.