Multiple inheritance
Multiple inheritance is an object-oriented inheritance model in which a class or type directly derives attributes or behavior from more than one parent.
Object-Oriented Software Design in C++
Multiple inheritance is inheritance in which a class derives directly from more than one superclass.
- How it is used
- Uses multiple inheritance to share toy play and sound behaviors while retaining each toy’s primary Toy superclass.
- How deep it goes
- Explains inheritance structure, explicit member qualification, duplication reduction, and hardcoded behavior limits before deferring to composition.
- Examples
- Uses ToyCar, ModelAirplane, and TrainSet classes with Roll, Fly, Engine, and ChooChoo behavior classes.
- What you can do after
- Evaluate when shared behavior inheritance reduces duplication and when composition better supports runtime flexibility and loose coupling.
Read how Object-Oriented Software Design in C++ explains multiple inheritance →
Practices of the Python Pro
Multiple inheritance is an inheritance mechanism in which a class derives from more than one parent class.
- How it is used
- Combines independent behaviors, implements multiple interfaces, and supports plugin architectures.
- How deep it goes
- Explains mixins, super(), and MRO calculation, including class ordering and inspection, while deferring deeper inheritance concepts.
- Examples
- Demonstrates dog behavior mixins and a Liger hierarchy whose prey methods expose MRO behavior.
- What you can do after
- Apply it via Python mixins, predict super() lookup, and inspect a class's method resolution order.
Read how Practices of the Python Pro explains multiple inheritance →
Data-Oriented Programming: Reduce software complexity
Multiple inheritance is a class-inheritance mechanism in which one class derives directly from more than one parent class.
- How it is used
- Uses multiple inheritance to share member and librarian capabilities while adding VIP and Super member features.
- How deep it goes
- Traces hierarchy changes through a class diagram and identifies diamond ambiguity, but stops short of resolving inheritance semantics.
- Examples
- Uses User, Member, Librarian, VIPMember, SuperMember, and UserWithBookItemRight in evolving class diagrams.
- What you can do after
- Evaluate class hierarchies for diamond ambiguity and recognize when composition may be safer.
Read how Data-Oriented Programming: Reduce software complexity explains multiple inheritance →
The Quick Python Book, Fourth Edition
Multiple inheritance is an object-oriented language feature in which a class derives attributes and behavior from more than one parent class.
- How it is used
- Uses multiple inheritance to combine definitions from several parent classes and to support mixin classes.
- How deep it goes
- Explains declaration, inherited behavior, ancestor compatibility, and method-search ordering, without detailing the complete lookup algorithm.
- Examples
- Uses an A–G inheritance hierarchy to demonstrate multiple parents, indirect ancestors, instance compatibility, and conflicting methods.
- What you can do after
- Evaluate Python inheritance hierarchies and predict which ancestor method a conflicting invocation searches first.
Read how The Quick Python Book, Fourth Edition explains multiple inheritance →
Related concepts
- inheritancekind of · Inheritance is a mechanism by which a child type or element receives properties, values, or behavior from a parent, subject to system rules and possible overrides.
- adapterused by · The adapter pattern is a structural design pattern in which a component translates between interfaces or representations so otherwise incompatible components can work together.
- Pythonused by · Python is a high-level, general-purpose, dynamically typed programming language with readable, indentation-based syntax and automatic memory management.
- diamond problemproduces · The diamond problem is ambiguity in multiple inheritance when distinct inheritance paths lead to a shared ancestor and conflict over inherited members.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



