Question #122

What is an advantage of using super() over calling the __init__() method of a parent class in the __init__() method of a child class?

The main advantage of super() is to ensure that the Method Resolution Order is called to detect the next inherited method in line. super() or not, a parent class has to be specified at the class definition level for inheritance to be applied. (realpython.com/python-super)


Comment on Disqus:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: