Test it out. Create a parent class with some attributes defined in the constructor. Do the same for the subclass. Now try to create an instance of the subclass setting each attribute, and check each attributes value. It should become apparent why you may want a reference to the parent class. Answer from Goingone on reddit.com
🌐
W3Schools
w3schools.com › python › ref_func_super.asp
Python super() Function
The super() function returns an object that represents the parent class. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] · If you want to report an error, or ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-super
Python super() - GeeksforGeeks
September 25, 2025 - In Python, the super() function is used to call methods from a parent (superclass) inside a child (subclass).
Discussions

What is the point of the super function in Python classes?
Test it out. Create a parent class with some attributes defined in the constructor. Do the same for the subclass. Now try to create an instance of the subclass setting each attribute, and check each attributes value. It should become apparent why you may want a reference to the parent class. More on reddit.com
🌐 r/learnpython
8
4
December 1, 2022
class - Understanding Python super() with __init__() methods - Stack Overflow
Why is super() used? Is there a difference between using Base.__init__ and super().__init__? class Base(object): def __init__(self): print "Base created" class ChildA... More on stackoverflow.com
🌐 stackoverflow.com
I am learning super keyword and constructors through youtube tutorials and not able to when to use "self" to initialize instance.

The super keyword refers to the parent class, which in this case is Animal. There is no reason to call Animal.__init__.

More on reddit.com
🌐 r/learnpython
4
1
May 15, 2024
Can anyone here explain self, super, and __init__ in layman’s terms?
In that example, what are self, super, and init doing and how does it make the code better? It doesn't make anything "better", per se, but it uses Object Oriented Principles (OOP) to structure the code. self is a reference to the object itself. So when the example says __init__(self), there is a reference made to that instantiation of the class. It is also why you will see class attributes prefixed with self as well, because those values are associated with that instance. def MyClass(): def __init__(self, x, y): self.xpos = x self.ypos = y init() is the initialization method of a class. It typically sets values when an instance of that class is created. super() is used to call a method from a parent class. So if you have an init method for a Monster class, and you have a child class called Goblin, you can initialize values from the Monster class inside of a Goblin instance by calling super().__init__(). More on reddit.com
🌐 r/learnpython
9
4
October 21, 2021
People also ask

Which is the best city in India for a programming course?
Some of the best cities where students can study at the top programming colleges in India are mentioned in the table below, along with the number of colleges in each city: Location No. of Colleges Maharashtra 140+ colleges Karnataka 70+ colleges Uttar Pradesh 60+ colleges West Bengal 45+ colleges Tamil Nadu 40+ colleges Gujarat 40+ colleges Haryana 35+ colleges Punjab 35+ colleges Disclaimer: This information is sourced from the official website and may vary.
🌐
shiksha.com
shiksha.com › home › it & software › programming › colleges in india
Super() Function in Python
Is there any scope in computer programming or app development?
Yes, programming languages like C, C+, Java, Kotlin, Swift, etc. Are typically used to create apps. The app is becoming more important and useful for everyone's lives, so it has a very broad scope. Every business and company needs software to use for some tasks of their company.
🌐
shiksha.com
shiksha.com › home › it & software › programming › colleges in india
Super() Function in Python
How many programming colleges are there in India?
There are more than 930+ Programming colleges in India where students can study. Some of the top colleges where students can learn programming include Amity University, MIT-WPU, Parul University, IIT Madras, IIT Kanpur, School of Engineering and Technology, Coding Ninjas, IIT Bombay, K J Somaiya School of Engineering, IIT Delhi, etc.
🌐
shiksha.com
shiksha.com › home › it & software › programming › colleges in india
Super() Function in Python
🌐
Programiz
programiz.com › python-programming › methods › built-in › super
Python super()
... The super() builtin returns a proxy object (temporary object of the superclass) that allows us to access methods of the base class. class Animal(object): def __init__(self, animal_type): print('Animal Type:', animal_type) class Mammal(Animal): def __init__(self):
🌐
Shiksha
shiksha.com › home › it & software › programming › colleges in india
Super() Function in Python
July 4, 2025 - Programmers often use an IDE, which allows them to create, edit, and test code. Without coding softwares are not imaginable. In India IT companies have lots of opportunities for good programmers. Languages like R, Python, JAVA, PHP and UNIX are some of the high demand programming languages.
🌐
Medium
medium.com › @thapavishal117 › super-in-python-b8c818782803
super() in python. In Python, the super() function is used… | by Vishal Thapa | Medium
October 5, 2023 - In Python, the super() function is used to call a method from a parent class (also called a superclass or base class) within a subclass. It allows you to access and utilize the methods and attributes defined in the parent class while customizing ...
🌐
Reddit
reddit.com › r/learnpython › what is the point of the super function in python classes?
r/learnpython on Reddit: What is the point of the super function in Python classes?
December 1, 2022 -

I’m taking a Python course and I’m having a hard time wrapping my head around it. If you use inheritance, then you already should have access to the parent classes’ methods and attributes. If the point of the super function is to give you access to the parent classes methods, isn’t this completely redundant?

Top answer
1 of 7
7
It can be a bit more complex than that. In a simple case, if, say, B inherits from A, but you want to use some of B's methods, you may think, "I can just call those methods myself - I know what they are." Ie: class B(A): def __init__(self, x, y): A.__init__(self, x) self.y = y def foo(self): x = A.foo(self) # Start with A's foo() result return do_something_extra(x) # And modify it slightly And this'll work fine - and is exactly what people did before super was added. And it seems like all you need: you obviously know what methods to call - you just wrote A in the inheritance tree right above it, so you know you need to call A.__init__, so why this extra super function? However, there are cases where this breaks. Consider multiple inheritance. Eg. suppose we have parents A and B, and C inherits from both. We obviously need to call A and B's __init__ method in C. Now, this initially seems simple enough. Just call both. Ie: class C(A, B): def __init__(self): A.__init__(self) B.__init__(self) No problem. But now suppose both A and B inherit from another class, X (ie a diamond inheritance pattern). Ie. A is defined with: class A(X): def __init__(self): X.__init__(self) And B is the same. Now our code has a problem - we end up calling X.__init__() twice for the same object. This is potentially a bug if X's initialiser triggers some side effect (eg. maybe it increments a counter for how many instances exist - now it'll be doublecounting the same object). And we'll also be calling it after A (it's subclass's) __init__ has completed so it could end up undoing some of the initialisation its child class did by resetting members etc. We really need this to be called only once, and before the rest of A and B's __init__ are finished. super() is designed to solve issues like this, and to do so, the notion of "parent" kind of breaks down a little. Instead, we define a single path through the tree (called the method resolution order). Calling super() in C gets you A, but then when A calls super(), it gets you B - even though B isn't anywhere in A's inheritance hierarchy, and then B's call to super() finally gets X. So we zig-zag through the inheritance hiererchy to get a single path that respects parent ordering etc. There's no way you sensibly can do this without super(), because B can't really know that sometimes A will be involved depending on its child class, and C, which does know, can't really easily monkey with what B does in its initialiser. Hence you need something more dynamic that can alter the resolution order depending on what class is actually being constructed. You can see this path via the __mro__ attribute on your class. Ie doing C.__mro__ in the above example would give you: (__main__.C, __main__.A, __main__.B, __main__.X, object)
2 of 7
5
Test it out. Create a parent class with some attributes defined in the constructor. Do the same for the subclass. Now try to create an instance of the subclass setting each attribute, and check each attributes value. It should become apparent why you may want a reference to the parent class.
Find elsewhere
🌐
Real Python
realpython.com › python-super
Supercharge Your Classes With Python super() – Real Python
August 16, 2024 - All methods that are called with super() need to have a call to their superclass’s version of that method. This means that you will need to add super().__init__() to the .__init__() methods of Triangle and Rectangle. Redesign all the .__init__() calls to take a keyword dictionary.
🌐
Real Python
realpython.com › ref › builtin-functions › super
super() | Python’s Built-in Functions – Real Python
The built-in super() function provides a way to access methods from a superclass from within a subclass.
Top answer
1 of 7
2374

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
1296

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.

🌐
FavTutor
favtutor.com › blogs › python-super-function
Python super() Function | With Code Examples
October 31, 2023 - In this case, the Animal class acts as the superclass, providing a common structure for different types of animals. Python's super keyword allows a subclass to invoke methods from its superclass. It is an essential element in ensuring that the ...
🌐
Board Infinity
boardinfinity.com › blog › python-super-keyword
Python super() keyword | Board Infinity
June 22, 2023 - In Python, the super() keyword is a built-in method that returns a proxy object (object of a superclass that is temporary). It allows us to access methods present in the base class.
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-super
Python super() - Python 3 super() | DigitalOcean
August 3, 2022 - As we have stated previously that Python super() function allows us to refer the superclass implicitly. But in the case of multi-level inheritances which class will it refer? Well, Python super() will always refer the immediate superclass. Also Python super() function not only can refer the __init__() function but also can call all other function of the superclass.
🌐
Python documentation
docs.python.org › 3 › library › functions.html
Built-in Functions — Python 3.14.2 documentation
Changed in version 3.8: The start parameter can be specified as a keyword argument. Changed in version 3.12: Summation of floats switched to an algorithm that gives higher accuracy and better commutativity on most builds. Changed in version 3.14: Added specialization for summation of complexes, using same algorithm as for summation of floats. class super¶ ·
🌐
Scaler
scaler.com › topics › super-in-python
super() in Python | super() Function in Python - Scaler Topics
April 8, 2022 - The super() function use the concept of MRO in the multiple inheritance. The super() function also takes two parameters i.e the immediate parent class name and the current object. Explore Scaler Topics Python Tutorial and enhance your Python skills with Reading Tracks and Challenges.
🌐
Quora
quora.com › What-is-the-use-of-a-super-keyword-in-Python
What is the use of a super keyword in Python? - Quora
Answer (1 of 2): super is used when you are using OOPs concept..During that to call the init of a main class from the base class you should use the super keyword
🌐
Medium
medium.com › @hudsonbrendon › inheritance-polymorphism-and-the-super-function-in-python-ed5c597474e5
Inheritance, Polymorphism, and the super() function in Python | by Hudson Brendon | Medium
June 12, 2024 - It allows us to extend/override methods from a superclass (parent class) to a subclass (child class). Through it, we define a new behavior for a certain method built in the parent class and inherited by the child class.
🌐
Fuhm
fuhm.net › super-harmful
Python's Super Considered Harmful
Thus, the general rule is: always pass all arguments you received on to the super function, and, if classes can take differing arguments, always accept *args and **kwargs. This is shown in Example 1-3. Just as a side note, I thought I'd mention that in Dylan, just "next-method" by itself with no argument-list does the same thing as Python's "super(MyClass, self).currentmethod(alltheargsideclared, *args, **kwargs)".
🌐
Python Reference
python-reference.readthedocs.io › en › latest › docs › functions › super.html
super — Python Reference (The Right Way) 0.1 documentation
Note that super() is implemented as part of the binding process for explicit dotted attribute lookups such as super().__getitem__(name). It does so by implementing its own __getattribute__() method for searching classes in a predictable order that supports cooperative multiple inheritance.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-super-with-__init__-method
Python Super() With __Init__() Method - GeeksforGeeks
July 23, 2025 - The super() function in Python is used to refer to the parent class. When used in conjunction with the __init__() method, it allows the child class to invoke the constructor of its parent class.
🌐
Quora
quora.com › How-do-you-call-a-super-function-in-Python
How to call a super function in Python - Quora
Answer (1 of 2): Let’s understand super( ) function. Super( ): Python super() function provides us the facility to refer to the parent class explicitly. It is basically useful where we have to call superclass functions.