Python Multiple Inheritance and MRO

Jack Dong
3 min readAug 27, 2023

Python Inheritance

Inheritance allows us to define a class that inherits all the methods and properties from another class.

The parent class is the class being inherited from, also called the base class.

The Child class is the class that inherits from another class, also called derived class.

A child class can be derived from more than one parent class in Python. This is called multiple inheritance.

Python Multiple Inheritance

For example, A class Dog is derived from parent classes Mammal and CanidaeAnimal. It makes sense because the dog is a mammal as well as a Canidae animal.

Use of super()

The Super() built-in gives you access to methods in a superclass from the subclass that inherits from it. It returns a temporary object of the superclass that allows you to call methods of the base class.

--

--