Reputation: 1024
In Python 3 I use super from inherited classes as follows:
class Orange(Fruit):
def __init__(self):
super().__init__()
In the code snippet above Orange
class inherits from Fruit
class. Take a look at the parent class
class Fruit():
def __init__(self):
pass # call super().__init__() here?
Do we need to call super from the parent/base class for the MRO to work effectively?
Upvotes: 0
Views: 71
Reputation: 6068
No, in Python there's no point in calling __init__
on super
for base classes and the MRO will still be properly initialised
Upvotes: 1