Multiple Inheritance

In Python, a class can inherit attributes and methods from more than one class. Critics of multiple inheritance say that it is confusing and complex, like the diamond problem, which is out of the scope of this lesson.

The idea that multiple inheritance is somehow “bad” is based on the fact that some languages either do not support multiple inheritance (like Java) or do not have a very good implementation for it. Python, however, has a very sophisticated and well-structured approach to multiple inheritance.

Consider the following code snippet where ChildClass inherits from ParentClass1, ParentClass2, ParentClass3, and so on.

Get hands-on with 1000+ tech skills courses.