...

/

Super Method

Super Method

This lesson covers multiple use-cases of the super method in Python and how it makes inheritance easier.

Introduction

As we discussed before, you can access the constructor and methods of the parent class in the child class using

ParentClassName.__init__(self, methodParameter)

and

ParentClassName.methodName(self, methodParameter)

respectively.

This method tends to get confusing when the hierarchy has multiple levels because you have to remember the exact names of the parent classes and where to use them. An easier way to do this is by using the super() method.

The built-in ...