How do I call a parent class's method from a child class in Python?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
In Python, the standard way for a child class to call a parent class method is super(). It is concise, respects Python's method resolution order, and is the right default in almost all inheritance code. Directly naming the parent class also works in some cases, but it is less flexible and becomes risky in multiple-inheritance hierarchies.
Basic Example with super()
Start with a parent method and override it in the child.
Output:
super().speak() calls the parent implementation before the child adds its own behavior.
Calling the Parent Constructor
The same pattern is common in __init__.
If the parent constructor initializes important state, skipping super().__init__() often leaves the object partially broken.
Direct Parent-Class Calls
You can also call the parent explicitly by name.
This works in simple inheritance, but it hardcodes the parent class into the child. That makes refactoring harder and breaks the cooperative behavior expected in multiple inheritance.
Why super() Is Better
super() is not just syntactic sugar. It participates in Python's method resolution order, or MRO, which defines how Python walks a class hierarchy.
That matters most when several base classes are involved.
super() lets each class cooperate with the MRO instead of jumping directly to one named parent.
When to Override and Extend Versus Replace
Not every override should call the parent method. It depends on semantics.
Call the parent when:
- the parent does essential setup
- you are extending behavior
- the class contract expects cooperative inheritance
Do not call the parent when:
- the child intentionally replaces the behavior
- the parent implementation is irrelevant or harmful for the child case
The decision is about class design, not only syntax.
Class Methods and Static Methods
The same idea applies to class methods, though the call looks slightly different.
For static methods, there is no implicit instance or class context, so direct naming is often simpler if you truly need to call the parent version.
A Practical Rule
For normal inheritance in modern Python:
- use
super()in instance methods - use
super()in constructors - use
super()in class methods when cooperating with a hierarchy
Only call the parent class by name when you have a specific reason and understand the tradeoff.
Common Pitfalls
One common mistake is forgetting to call super().__init__() when the parent constructor sets up required attributes.
Another mistake is using direct parent-class calls in a codebase that later grows into multiple inheritance. That can bypass the intended MRO completely.
Developers also assume super() means "call my immediate parent." In Python, it really means "continue method lookup according to the MRO."
Finally, some child overrides call the parent unconditionally even when the child is supposed to replace, not extend, the behavior.
Summary
- The standard way to call a parent method in Python is
super(). - '
super()is the right default because it respects the method resolution order.' - Direct parent-class calls work in simple cases but are less flexible.
- Constructors are a common place where
super()is essential. - Choose whether to extend or replace parent behavior intentionally, not mechanically.

