liveBook · Manning

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.

How 4 Manning books explain it

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 →

Also covered in

What to know first

Related concepts

Questions about multiple inheritance

What is 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.

Which Manning books explain multiple inheritance?

Object-Oriented Software Design in C++, Practices of the Python Pro, Data-Oriented Programming: Reduce software complexity and The Quick Python Book, Fourth Edition.

What should I know before learning multiple inheritance?

Manning books that teach multiple inheritance usually introduce inheritance, atomic type, method and object first.

What is the difference between multiple inheritance and single 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. Single inheritance is an inheritance model in which each class has at most one direct superclass.

What is multiple inheritance a kind of?

Multiple inheritance is a kind of inheritance. Inheritance is a mechanism in which a derived type or descendant element receives properties or behavior from a parent, subject to rules that may allow specialization or overriding.

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.