Back to search

Inheritance, multiple inheritance, method overriding, `super()`, and MRO

Inheritance reuses behavior, overriding customizes it, `super()` follows the method resolution order, and multiple inheritance works only if the MRO stays coherent.

Python Medium Theory

Inheritance, multiple inheritance, method overriding, `super()`, and MRO

Inheritance reuses behavior, overriding customizes it, `super()` follows the method resolution order, and multiple inheritance works only if the MRO stays coherent.

  • Override behavior intentionally
  • `super()` cooperates with MRO
  • Multiple inheritance needs careful design

Inheritance, multiple inheritance, method overriding, `super()`, and MRO