Browse by Topic

Popular

Latest

Latest Posts

Diagram illustrating Python method resolution order in a multiple inheritance class hierarchy.
Python

Python Multiple Inheritance Method Resolution Explained

Learn how Python resolves methods in multiple inheritance, including C3 linearization, cooperative super() chains, and common MRO pitfalls.

PythonMROmultiple inheritancesuper()
Illustration of Python constructor inheritance showing a child class calling parent __init__ via super()
Python

Python Constructor Inheritance: How to Call Parent __init__

Python constructor inheritance can be confusing: a subclass inherits the parent's `__init__` only when it does not override it. Once you define `__init__`, call `super().__init__()` explicitly to run the parent's initialization.

PythonOOPsuper()__init__
Diagram showing how a super() call in a Python class resolves to the next class in the method resolution order.
Python

Python super() Method Call: Syntax and Behavior

The Python super() method call resolves the next class in the MRO. This article explains the syntax, cooperative multiple inheritance, common mistakes, and when direct parent calls are preferable.

super()method resolution ordermultiple inheritancePython OOP
A Python subclass overriding a method inherited from a parent class, illustrated with layered class blocks and an override arrow.
Python

Overriding Inherited Methods in Python: Syntax and Behavior

A practical overview of overriding inherited methods in Python: syntax, super(), special methods, method resolution order, and common mistakes.

method overridinginheritancesuper()polymorphism
Illustration of Python method overriding showing a child class replacing a parent method
Python

Python Method Overriding: How It Works and When to Use It

Python method overriding lets a subclass replace a parent method. Learn how it works with super(), MRO, and abstract base classes.

PythonOOPInheritancesuper()
Diagram of a Python derived class inheriting from a base class with shared and overridden methods
Python

Python Base and Derived Classes: How Inheritance Works

Learn how Python base and derived classes work: inheritance syntax, super(), method overriding, MRO, and composition tradeoffs.

PythonInheritanceOOPMethod Resolution Order
Diagram showing a child class inheriting from a parent class in Python, with an arrow indicating the inheritance relationship.
Python

Python Parent Class Child Class: Inheritance in Practice

Learn Python inheritance with parent and child classes: constructor chaining, super(), method overriding, MRO, and maintainability trade-offs.

inheritancesupermethod-overridingmultiple-inheritance
Diagram showing Python class inheritance with super() in __init__
Python

Python super().__init__() Explained

Learn how Python's super().__init__() works, why it matters for inheritance, and how to avoid common mistakes when calling parent constructors.

pythonsuperinitinheritance
A diagram showing a Python class hierarchy with super() delegating method calls along the method resolution order.
Python

Python super() Function Explained

Understand how Python's super() works, how it uses the MRO, and when to use it in single and multiple inheritance for maintainable code.

super()MROmultiple inheritancecooperative inheritance
Diagram of a diamond-shaped class hierarchy in Python showing the method resolution order path through hybrid inheritance.
Python

Python Hybrid Inheritance and the MRO

Understand how Python resolves hybrid inheritance through C3 linearization, the diamond problem, and cooperative super() chains.

multiple inheritanceMROsuper()diamond problem