Use super() inside a class to call methods from the next class in Python's method resolution order (MRO). The most common pattern is super().__init__() in a child class constructor.
In simple inheritance, super() usually calls the immediate parent. In multiple inheritance, super() follows the MRO—the next class in that order, not necessarily a direct parent. Python's official docs describe super() as returning a proxy for cooperative delegation, especially in multiple inheritance.
Tested on: Python 3.13.3; kernel 6.14.0-37-generic.
Python super() quick reference
| Task | Use |
|---|---|
| Call parent initializer | super().__init__(args) |
| Call parent method | super().method_name(args) |
| Extend overridden method | super().method_name() inside child method |
| Check method lookup order | ClassName.mro() or ClassName.__mro__ |
| Python 3 recommended form | super() |
| Older explicit form | super(CurrentClass, self) |
| Multiple inheritance behavior | Follows MRO |
| Avoid hard-coding parent class | Use super() |
What is super() in Python?
super()is a built-in function.- It returns a proxy object.
- That proxy delegates method calls to the next class in the MRO.
- It is mainly used with inheritance.
- It avoids hard-coding the parent class name in every call.
You typically write super() with no arguments inside a class method in Python 3.
Why use super()?
super() helps you:
- Run parent initialization logic from a child
__init__() - Reuse parent methods instead of duplicating code
- Extend an overridden method rather than replace it entirely
- Keep code maintainable when class names change
- Support cooperative multiple inheritance when every class in the chain calls
super()
super() is useful, but not required in every class—only when you need parent setup or shared behavior.
Python super().init() example
When a child defines its own __init__(), call super().__init__() so parent attributes are initialized, then set child-specific fields. The Python constructor guide explains __init__ parameters, defaults, and validation on both parent and child sides.
class Person:
def __init__(self, name):
self.name = name
class Employee(Person):
def __init__(self, name, employee_id):
super().__init__(name)
self.employee_id = employee_id
employee = Employee("Alice", 101)
print(employee.name)
print(employee.employee_id)The output is Alice and 101. Parent logic runs first; the child adds employee_id.
What happens if you do not call super().init()?
If the child defines __init__() and skips super().__init__(), the parent initializer does not run automatically:
class Parent:
def __init__(self):
self.ready = True
class Child(Parent):
def __init__(self):
self.extra = 1
child = Child()
print(child.extra)
try:
print(child.ready)
except AttributeError as e:
print(e)The first print succeeds (1), but child.ready raises AttributeError because Parent.__init__() never ran.
Always call super().__init__(...) when the parent constructor sets up state the child relies on.
Call a parent method using super()
super() is not limited to __init__(). Call any parent method when the child extends behavior:
class Vehicle:
def describe(self):
return "Vehicle"
class Car(Vehicle):
def describe(self):
base = super().describe()
return f"{base} with four wheels"
print(Car().describe())The output is Vehicle with four wheels.
Method overriding with super()
Overriding means defining a method in the child with the same name as in the parent.
- Use
super().method()when you want parent behavior plus child additions. - Replace the method entirely when parent behavior should not run.
class Animal:
def speak(self):
return "..."
class Dog(Animal):
def speak(self):
return super().speak() + " bark"
print(Dog().speak())You get ... bark.
super() in single inheritance
With one parent class, super() usually calls that parent's method—the easiest mental model for beginners.
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
class Student(Person):
def __init__(self, name, age, student_id):
super().__init__(name, age)
self.student_id = student_id
student = Student("Bob", 20, "S-42")
print(student.name, student.age, student.student_id)Output: Bob 20 S-42.
super() and multiple inheritance
With multiple inheritance, super() does not simply mean “call the parent.” It calls the next class in the MRO.
For cooperative design, each class should call super().__init__() with a compatible signature so initialization flows once through the diamond without duplicating base setup.
class A:
def __init__(self):
print("A init")
class B(A):
def __init__(self):
print("B init")
super().__init__()
class C(A):
def __init__(self):
print("C init")
super().__init__()
class D(B, C):
def __init__(self):
print("D init")
super().__init__()
D()Output order: D init, B init, C init, A init — A runs once, not twice.
Hard-coding A.__init__(self) from both B and C would risk double initialization of A.
Method Resolution Order, or MRO
The MRO is the order Python searches for methods and attributes. super() follows this order.
Inspect it with ClassName.mro() or ClassName.__mro__:
class A:
pass
class B(A):
pass
class C(A):
pass
class D(B, C):
pass
print(D.mro())You see [D, B, C, A, object] — read left to right as the lookup order.
super() vs parent class name
| Approach | Example | Notes |
|---|---|---|
super() |
super().__init__() |
Recommended in modern Python 3 |
| Parent class name | Parent.__init__(self) |
Works in simple cases but hard-codes the parent |
| Explicit super form | super(Child, self).__init__() |
Older Python 2 style; still valid but rarely needed in Python 3 |
Prefer super() unless you have a specific reason to name the parent explicitly.
super().init() with arguments
Pass required parent arguments through super().__init__():
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
class Employee(Person):
def __init__(self, name, age, department):
super().__init__(name, age)
self.department = department
emp = Employee("Carol", 30, "Engineering")
print(emp.name, emp.department)The child accepts extra arguments while forwarding shared ones to the parent. In multiple inheritance, keep __init__ signatures compatible across cooperating classes.
Can super() access parent variables?
Clarification for beginners:
- Use
super()to call methods (including__init__). - After
super().__init__()runs, access instance attributes withself.name,self.age, and so on—they were created onselfduring parent initialization. super().some_attributeis not the usual pattern for normal instance fields.
class Parent:
def __init__(self):
self.count = 0
class Child(Parent):
def __init__(self):
super().__init__()
self.count += 1
c = Child()
print(c.count)Output is 1. Use self.count, not super().count, for typical instance data.
Common mistakes with super()
- Forgetting parentheses —
super.__init__instead ofsuper().__init__(). - Skipping
super().__init__()in a child__init__()when parent setup is required. - Wrong arguments to
super().__init__(...). - Assuming
super()always means direct parent — in multiple inheritance it follows MRO. - Hard-coding
Parent.__init__(self)in diamond hierarchies — can duplicate base initialization. - Calling both
Parent.__init__(self)andsuper().__init__()— risk double initialization. - Incompatible
__init__signatures in cooperative multiple inheritance. - Misspelling
super()assupper()— not a built-in function. - Using
super()outside a method without the two-argument form —super()with no args only works inside a class method.
Summary
super() delegates to the next class in the MRO. Use super().__init__() to initialize parent state in child constructors. Use super().method() to extend overridden methods. In single inheritance, super() usually behaves like calling the parent. In multiple inheritance, it follows the MRO and works best when all classes cooperate with consistent super() calls. For the broader class syntax that makes inheritance possible, start with the Python class example tutorial.
Useful references

