Jun-19-2020, 11:55 PM
Hi Viewer,
I have two questions related to inheritance:
1. Let's say I have a class A and another class B which is inheriting A. So B is the subclass of A. When instantiating the class B does the super class A also get instantiated?
2. When I am using super() in the sub class what does it actually contain? The reference of the subclass or a reference to the super class? The self parameter contains the reference to the current class. Similarly does super() contain the reference to the super class?
Please clarify.
Thanks.
I have two questions related to inheritance:
1. Let's say I have a class A and another class B which is inheriting A. So B is the subclass of A. When instantiating the class B does the super class A also get instantiated?
2. When I am using super() in the sub class what does it actually contain? The reference of the subclass or a reference to the super class? The self parameter contains the reference to the current class. Similarly does super() contain the reference to the super class?
Please clarify.
Thanks.