Multiple inheritance lets a Python class derive data and behavior from more than one parent class. The resulting class combines its own definitions with those inherited from its ancestors, and an instance can be used as an instance of each ancestor class. section 15.13
The basic rules are:
- A class may list any number of parent classes, using the same syntax as single inheritance. section 15.13
- When inherited classes have different method names, the subclass behaves like a synthesis of its definitions and its ancestors’ definitions. section 15.13
- When several ancestors define the same method, Python searches base classes from left to right, completing one base class’s ancestor search before moving to the next. section 15.13
- Multiple inheritance is also commonly used with mixin classes. section 15.15
A branched inheritance hierarchy
A class can combine several branches: B inherits from E and F, D inherits from G, and A inherits from B, C, and D. An instance of A can be used as an instance of A, B, C, D, E, F, or G. If several of those classes define the same method, the inheritance order determines which definition Python searches first. section 15.13
class E:
. . .
class F:
. . .
class G:
. . .
class D(G):
. . .
class C:
. . .
class B(E, F):
. . .
class A(B, C, D):
. . .
Inspect the compact class declarations for the A–G multiple-inheritance hierarchy. section 15.13



