super()

Built-in FunctionPython 2.0+Intermediate

Returns a proxy object that delegates calls to a parent class

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
class Animal:
    def speak(self):
        return "..."

class Dog(Animal):
    def speak(self):
        parent = super().speak()
        return f"{parent} Woof!"

print(Dog().speak())

super() is a built-in function that returns a proxy object that delegates calls to a parent class.

Try in Playground

Tags

builtinfunctioncoreoopinheritance

Related Items