Oct-15-2020, 03:12 PM
All,
Is this behavior correct for ABC class? I expected only the method in class S to be printed. Is this the correct behavior?
David
Is this behavior correct for ABC class? I expected only the method in class S to be printed. Is this the correct behavior?
import abc
from abc import ABC, abstractmethod
class R(ABC):
def rk(self):
print("Abstract Base Class")
class K(R):
def rk(self):
super().rk()
print("subclass ")
class S(K):
def rk(self):
super().rk()
print("Class S")
# Driver code
t = S()
t.rk()
'''
This prints
Abstract Base Class
subclass
Class S
'''All the Best,David
