The super() function in Python returns a proxy object that lets a subclass call methods of its parent classes without naming them. It is mainly used to run the parent's __init__() or to extend an overridden method, and in multiple inheritance it follows the method resolution order (MRO) so that each class in the hierarchy runs exactly once.
In Python 3 you call it with no arguments, as super().method(). The two-argument form super(Child, self) from Python 2 still works but is no longer needed.
super() workssuper() in class methods, static methods and propertiessuper() workssuper() does not simply mean "the parent class". It means "the next class after the current one in the MRO of the instance". For single inheritance that is the parent, but with several bases it can be a sibling class.
The zero-argument form works because the compiler gives each method that mentions super a hidden __class__ cell, and Python takes the first argument (self or cls) from the method itself. So it only works inside methods defined in a class body.
The most common use is initialising state set by the parent class. If you override __init__() and forget to call super().__init__(), the parent's attributes are never created.
The same pattern works with @dataclass classes and with built-in types, for example class MyError(Exception) calling super().__init__(message).
With a diamond-shaped hierarchy, super() visits each class once, in the order given by ClassName.__mro__, which is computed by the C3 linearisation algorithm.
B.greet() calls super().greet(), and for a D instance the next class after B is C, not A. That is why C runs before B finishes, and A runs only once. If B had called A.greet(self) directly, A would run twice in the diamond case.
For cooperative multiple inheritance, accept *args and **kwargs in __init__() and pass them on through super().__init__(*args, **kwargs), so each class in the chain can take what it needs.
super() in class methods, static methods and propertiessuper() also works in @classmethod methods, where it binds to the class, and you can reach a parent property through it.
Note that super().attribute = value does not work. Assignment through super() is not supported, and reading a parent property is possible (super().prop) but setting it needs Parent.prop.fset(self, value).
super().__init__() when the parent sets up required state.super() outside a method, or inside a nested function that has no self argument, which raises RuntimeError: super(): no arguments.Parent.method(self) with super() in the same hierarchy, which can run a method twice or skip a class.super() always means the direct parent in multiple inheritance.__init__ signatures along the chain without **kwargs.No. Plain super() is equivalent inside a method and is the recommended style. The explicit form is only needed in rare cases, for example outside a class body.
Calling Parent.__init__(self) hard-codes one class and bypasses the MRO. super().__init__() follows the MRO, so it stays correct when the hierarchy changes or has several bases.
Every class inherits from object, so super() always resolves, but it only matters when a parent class defines the method you want to extend.
Print ClassName.__mro__ or call ClassName.mro(). super() moves along that list.
super() gives a subclass access to the next class in the MRO. Use it in __init__() and overridden methods to extend rather than replace parent behaviour, prefer it over naming the parent directly, and design multiple-inheritance hierarchies so every class cooperates by calling super() and forwarding **kwargs.