fbpx

Tag - inheritence

super in python

“Super” in python: why and when to use

One of the primary OOPS concept that dominates python is Inheritance. Super is useful for accessing inherited methods that have been overridden in a class. For more theory details, refer Python's official doc on Super. Lets start with practical example: [code language="python"] class A(object): print ("I am in class A") class B(A): print ("I am in class B") B_obj=B() [/code] In the above code we have defined two classes...