For a simple example as in your question, indeed it makes no point. It will simply call object.__init__
which doesn't do much and takes no arguments.
BUT, it makes a difference with multiple inheritance. For example, the following code:
class Base:
def __init__(self, *args, **kwrgs):
super().__init__(*args, **kwrgs)
print("in Base")
class SecondBase:
def __init__(self, *args, **kwrgs):
super().__init__(*args, **kwrgs)
print("in SecondBase")
class A(Base, SecondBase):
def __init__(self, *args, **kwrgs):
super().__init__(*args, **kwrgs)
print("in A")
class B(SecondBase, Base):
def __init__(self, *args, **kwrgs):
super().__init__(*args, **kwrgs)
print("in B")
print("A:")
A()
print("B:")
B()
Will produce:
A:
in SecondBase
in Base
in A
B:
in Base
in SecondBase
in B
As you can see, both Base
and SecondBase
are what you would call base classes, i.e. not inheriting. Still, because of A
and B
's multiple inheritance, the super()
calls return either Base
/SecondBase
respectively or object
, depending on the MRO
. This can be seen as:
>>> A.mro()
[<class '__main__.A'>, <class '__main__.Base'>, <class '__main__.SecondBase'>, <class 'object'>]
>>> B.mro()
[<class '__main__.B'>, <class '__main__.SecondBase'>, <class '__main__.Base'>, <class 'object'>]