flâneur — a map of the web's best reading

Python super() - GeeksforGeeks

geeksforgeeks.org · 1,053 words · saved by 1 readers

In Python, the super() function is used to refer to the parent class or superclass. It allows you to call methods defined in the superclass from the subclass, enabling you to extend and customize the functionality inherited from the parent class. Syntax: super() Return : Return a proxy object which represents the parent’s class. In the given example, The Emp class has an __init__ method that initializes the id, and name and Adds attributes. The Freelance class inherits from the Emp class and adds an additional attribute called Emails. It calls the parent class’s __init__ method super() to initialize the inherited attribute. Output : A method from a parent class can be called in Python using the super() function. It’s typical practice in object-oriented programming to call the methods of the superclass and enable method overriding and inheritance. Even if the current class has replaced those methods with its own implementation, calling super() allows you to access and use the parent cla

Python super() - GeeksforGeeks Courses Tutorials Interview Prep Python Tutorial Data Types Interview Questions Examples Quizzes DSA Python Data Science NumPy Pandas Practice Django Flask Python super() Last Updated : 18 Mar, 2026 In Python, super() function is used to call methods from a parent (superclass) inside a child (subclass). It allows to extend or override inherited methods while still reusing the parent's functionality. Let's understand how super() works with an example where a child class calls a method from its parent class. Python class Parent : def show ( self ): print ( "This is

Explore this link on the map →

related reading