There is no super keyword instead Super function is used in Python to give access to methods and properties of a parent or sibling class.
This function returns an object that represents the parent class.
Example Super keyword function in Python
A simple example codes the class that will inherit all the methods and properties from another class. Python subclasses can use the super keyword when calling the members of the parent class.
class Parent: def __init__(self, msg): self.message = msg def display(self): print(self.message) class Child(Parent): def __init__(self, msg): super().__init__(msg) obj = Child("Hello, Super!") obj.display()
Do comment if you have any doubts or suggestions on this Python keyword tutorial.
Note: IDE: PyCharm 2021.3.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.