In line with the other answers, there are multiple ways to call super class methods (including the constructor), however in Python 3 the process has been simplified:

Python 3

class A(object):
    def __init__(self):
        print("world")

class B(A):
    def __init__(self):
        print("hello")
        super().__init__()

Python 2

In Python 2, you have to call the slightly more verbose version super(<containing classname>, self), which is equivalent to super()as per the docs.

class A(object):
    def __init__(self):
        print "world"

class B(A):
    def __init__(self):
        print "hello"
        super(B, self).__init__()
Answer from Aidan Gomez on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › calling-a-super-class-constructor-in-python
Calling a Super Class Constructor in Python - GeeksforGeeks
August 1, 2020 - python3 · # this is the class which will become # the super class of "Subclass" class class Class(): def __init__(self, x): print(x) # this is the subclass of class "Class" class SubClass(Class): def __init__(self, x): # this is how we call super # class's constructor super().__init__(x) # driver code x = [1, 2, 3, 4, 5] a = SubClass(x) Output : [1, 2, 3, 4, 5] Super with Multiple Inheritance : Example : Implement the following inheritance structure in python using the super function : Inheritance Structure ·
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-super
Python super() - GeeksforGeeks
3 weeks ago - super().__init__(name, id) calls the parent constructor to initialize inherited attributes. Creating emp = Emp("James", 103) sets both parent and child attributes correctly. In a multilevel inheritance setup, super() ensures that each parent class constructor is executed in the correct sequence. It follows Python’s Method Resolution Order (MRO) to maintain a consistent and predictable flow of initialization.
🌐
Real Python
realpython.com › python-super
Supercharge Your Classes With Python super() – Real Python
August 16, 2024 - Because the Square and Rectangle .__init__() methods are so similar, you can simply call the superclass’s .__init__() method (Rectangle.__init__()) from that of Square by using super(). This sets the .length and .width attributes even though you just had to supply a single length parameter to the Square constructor. When you run this, even though your Square class doesn’t explicitly implement it, the call to .area() will use the .area() method in the superclass and print 16. The Square class inherited .area() from the Rectangle class. Note: To learn more about inheritance and object-oriented concepts in Python, be sure to check out Inheritance and Composition: A Python OOP Guide and Object-Oriented Programming (OOP) in Python.
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-super
Python super() - Python 3 super() | DigitalOcean
August 3, 2022 - At first, just look at the following code we used in our Python Inheritance tutorial. In that example code, the superclass was Person and the subclass was Student. So the code is shown below. class Person: # initializing the variables name = "" age = 0 # defining constructor def __init__(self, person_name, person_age): self.name = person_name self.age = person_age # defining class methods def show_name(self): print(self.name) def show_age(self): print(self.age) # definition of subclass starts here class Student(Person): studentId = "" def __init__(self, student_name, student_age, student_id):
🌐
Real Python
realpython.com › python-class-constructor
Python Class Constructors: Control Your Object Instantiation – Real Python
January 19, 2025 - Now, if you need a custom implementation of this method, then you should follow a few steps: Create a new instance by calling super().__new__() with appropriate arguments. Customize the new instance according to your specific needs. Return the new instance to continue the instantiation process. With these three succinct steps, you’ll be able to customize the instance creation step in the Python instantiation process.
🌐
Runestone Academy
runestone.academy › ns › books › published › fopp › Inheritance › InvokingSuperMethods.html
22.4. Invoking the Parent Class’s Method — Foundations of Python Programming
So, it’s better to use super(). This technique is very often used with the __init__ method for a subclass. Suppose that some extra instance variables are defined for the subclass. When you invoke the constructor, you pass all the regular parameters for the parent class, plus the extra ones for the subclass. The subclass’ __init__ method then stores the extra parameters in instance variables and calls the parent class’ __init__ method to store the common parameters in instance variables and do any other initialization that it normally does.
🌐
AskPython
askpython.com › home › understanding the super() method in python
Understanding the super() Method in Python - AskPython
August 6, 2022 - Here, the derived class Newdemo calls the super() with arguments a, b, and c. This causes the constructor __init__ of the base class, i.e. Demo to be called. This initialises the values of a, b, and c.
Find elsewhere
🌐
GeeksforGeeks
origin.geeksforgeeks.org › calling-a-super-class-constructor-in-python
Calling a Super Class Constructor in Python | GeeksforGeeks
August 1, 2020 - In Python, the __init__() method is called the constructor and is always called when an object is created. ... Python has super function which allows us to access temporary object of the super class.
🌐
Python documentation
docs.python.org › 3 › tutorial › classes.html
9. Classes — Python 3.14.3 documentation
In fact, it is slightly more complex than that; the method resolution order changes dynamically to support cooperative calls to super().
🌐
Delft Stack
delftstack.com › home › howto › python › python call super constructor
How to Invoke the Super Constructor of the Parent Class in Python | Delft Stack
February 2, 2024 - The child class inherits all the attributes and the methods of the parent class. This statement super().__init__(name, age, gender) invoked the Person class’s constructor. Note that it is necessary to invoke the parent class’s constructor; otherwise, the code will break.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-super-with-__init__-method
Python Super() With __Init__() Method - GeeksforGeeks
July 23, 2025 - In this example, below Python code defines three classes, `A`, `B`, and `C`. Class `C` inherits from both `A` and `B`. In the `__init__` method of class `C`, `super().__init__(a)` is used to call the constructor of class `A` with the parameter `a`, and `B.__init__(self, b)` is used to call the constructor of class `B` with the parameter `b`. An instance of class `C` named `my_instance` is created with specific attributes for each class.
Top answer
1 of 7
2378

super() lets you avoid referring to the base class explicitly, which can be nice. But the main advantage comes with multiple inheritance, where all sorts of fun stuff can happen. See the standard docs on super if you haven't already.

Note that the syntax changed in Python 3.0: you can just say super().__init__() instead of super(ChildB, self).__init__() which IMO is quite a bit nicer. The standard docs also refer to a guide to using super() which is quite explanatory.

2 of 7
1297

I'm trying to understand super()

The reason we use super is so that child classes that may be using cooperative multiple inheritance will call the correct next parent class function in the Method Resolution Order (MRO).

In Python 3, we can call it like this:

class ChildB(Base):
    def __init__(self):
        super().__init__()

In Python 2, we were required to call super like this with the defining class's name and self, but we'll avoid this from now on because it's redundant, slower (due to the name lookups), and more verbose (so update your Python if you haven't already!):

        super(ChildB, self).__init__()

Without super, you are limited in your ability to use multiple inheritance because you hard-wire the next parent's call:

        Base.__init__(self) # Avoid this.

I further explain below.

"What difference is there actually in this code?:"

class ChildA(Base):
    def __init__(self):
        Base.__init__(self)

class ChildB(Base):
    def __init__(self):
        super().__init__()

The primary difference in this code is that in ChildB you get a layer of indirection in the __init__ with super, which uses the class in which it is defined to determine the next class's __init__ to look up in the MRO.

I illustrate this difference in an answer at the canonical question, How to use 'super' in Python?, which demonstrates dependency injection and cooperative multiple inheritance.

If Python didn't have super

Here's code that's actually closely equivalent to super (how it's implemented in C, minus some checking and fallback behavior, and translated to Python):

class ChildB(Base):
    def __init__(self):
        mro = type(self).mro()
        check_next = mro.index(ChildB) + 1 # next after *this* class.
        while check_next < len(mro):
            next_class = mro[check_next]
            if '__init__' in next_class.__dict__:
                next_class.__init__(self)
                break
            check_next += 1

Written a little more like native Python:

class ChildB(Base):
    def __init__(self):
        mro = type(self).mro()
        for next_class in mro[mro.index(ChildB) + 1:]: # slice to end
            if hasattr(next_class, '__init__'):
                next_class.__init__(self)
                break

If we didn't have the super object, we'd have to write this manual code everywhere (or recreate it!) to ensure that we call the proper next method in the Method Resolution Order!

How does super do this in Python 3 without being told explicitly which class and instance from the method it was called from?

It gets the calling stack frame, and finds the class (implicitly stored as a local free variable, __class__, making the calling function a closure over the class) and the first argument to that function, which should be the instance or class that informs it which Method Resolution Order (MRO) to use.

Since it requires that first argument for the MRO, using super with static methods is impossible as they do not have access to the MRO of the class from which they are called.

Criticisms of other answers:

super() lets you avoid referring to the base class explicitly, which can be nice. . But the main advantage comes with multiple inheritance, where all sorts of fun stuff can happen. See the standard docs on super if you haven't already.

It's rather hand-wavey and doesn't tell us much, but the point of super is not to avoid writing the parent class. The point is to ensure that the next method in line in the method resolution order (MRO) is called. This becomes important in multiple inheritance.

I'll explain here.

class Base(object):
    def __init__(self):
        print("Base init'ed")

class ChildA(Base):
    def __init__(self):
        print("ChildA init'ed")
        Base.__init__(self)

class ChildB(Base):
    def __init__(self):
        print("ChildB init'ed")
        super().__init__()

And let's create a dependency that we want to be called after the Child:

class UserDependency(Base):
    def __init__(self):
        print("UserDependency init'ed")
        super().__init__()

Now remember, ChildB uses super, ChildA does not:

class UserA(ChildA, UserDependency):
    def __init__(self):
        print("UserA init'ed")
        super().__init__()

class UserB(ChildB, UserDependency):
    def __init__(self):
        print("UserB init'ed")
        super().__init__()

And UserA does not call the UserDependency method:

>>> UserA()
UserA init'ed
ChildA init'ed
Base init'ed
<__main__.UserA object at 0x0000000003403BA8>

But UserB does in-fact call UserDependency because ChildB invokes super:

>>> UserB()
UserB init'ed
ChildB init'ed
UserDependency init'ed
Base init'ed
<__main__.UserB object at 0x0000000003403438>

Criticism for another answer

In no circumstance should you do the following, which another answer suggests, as you'll definitely get errors when you subclass ChildB:

super(self.__class__, self).__init__()  # DON'T DO THIS! EVER.

(That answer is not clever or particularly interesting, but in spite of direct criticism in the comments and over 17 downvotes, the answerer persisted in suggesting it until a kind editor fixed his problem.)

Explanation: Using self.__class__ as a substitute for explicitly passing the class by name in super() will lead to recursion. super lets us look up the next parent in the MRO (see the first section of this answer) for child classes. If we tell super we're in the child's method, it will then lookup the next method in line (probably this same one we are calling it from) resulting in recursion, causing either a logical failure (as in the answerer's example) or a RuntimeError when the maximum recursion depth is exceeded.

class Polygon(object):
    def __init__(self, id):
        self.id = id

class Rectangle(Polygon):
    def __init__(self, id, width, height):
        super(self.__class__, self).__init__(id)
        self.shape = (width, height)

class Square(Rectangle):
    pass

>>> Square('a', 10, 10)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in __init__
TypeError: __init__() missing 2 required positional arguments: 'width' and 'height'

Python 3's new super() calling method with no arguments fortunately allows us to sidestep this issue.

🌐
Medium
medium.com › @AISciencesLearn › calling-parent-class-constructor-via-a-child-class-in-python-28664f0002aa
Calling Parent Class Constructor via a Child Class in Python | by AI SCIENCES | Medium
February 8, 2023 - class Circle(Shape): def __init__(self, name, area, radius): #calling parent class constructor super().__init__(name, area) self.radius = radius def display_circle_attr(self): print("The radius of the circle is ", self.radius) Now, when you create an object of the Circle class, you pass three parameter values. The first two parameter values will initialize the parent class attributes: name and area, while the third parameter will initialize the child class attribute, radius.
🌐
Datadog
docs.datadoghq.com › security › code_security › static_analysis › static_analysis_rules › python-best-practices › init-call-parent
use super() to call the parent constructor
Calling the parent constructor should be done by calling super(), not by calling the parent object directly. class Class(Parent): def __init__(self): SomeClass.__init__(self) # should use super()
🌐
Sentry
sentry.io › sentry answers › python › `super()` and `__init__()` in python
`super()` and `__init__()` in Python | Sentry
July 15, 2023 - The line starting with super().__init__ will execute the __init__ method of Product as if it were a method defined in Perishable. This saves us from having to rewrite our pricing code in every child class of Product.
🌐
Mga
comp.mga.edu › learning › python › module › 12
School of Computing - Learning Python
Superclass and Subclass: Car is the superclass, and RV and Truck are subclasses. Inheritance: Both RV and Truck inherit attributes and methods from Car. Constructor Call: super().__init__(make, model, year) ensures that the Car constructor is called.
🌐
W3Schools
w3schools.com › python › python_inheritance.asp
Python Inheritance
class Student(Person): def __init__(self, fname, lname): super().__init__(fname, lname) Try it Yourself » · By using the super() function, you do not have to use the name of the parent element, it will automatically inherit the methods and properties from its parent. Add a property called graduationyear to the Student class:
🌐
Python
typing.python.org › en › latest › spec › constructors.html
Constructors — typing documentation
If the class is not explicitly specialized, class-scoped type variables should be solved using the supplied arguments passed to the constructor call. class MyClass[T]: def __new__(cls, x: T) -> Self: return super().__new__(cls) # Constructor calls for specialized classes assert_type(MyClass[int](1), MyClass[int]) assert_type(MyClass[float](1), MyClass[float]) MyClass[int](1.0) # Type error # Constructor calls for non-specialized classes assert_type(MyClass(1), MyClass[int]) assert_type(MyClass(1.0), MyClass[float])