Every class in python 2.6 and above inherits from object
unless explicitly stated otherwise, so class MyParentClass():
is equivalent to class MyParentClass(object)
. Under normal circumstances, the super
call is accessing object.__init__
.
Under less normal circumstances, MyParentClass
may be a mixin. This is a class that participates in multiple inheritance in a way that adds functionality to the child without being part of the main inheritance chain. I this case, super
is referring to some unknown base class in the MRO. The reason that you would want to call the unknown __init__
method in this case is to continue the chain of __init__
calls all the way to the base class.