class ClassType:
type = "default"
def __init__(self):
self.show = self.type
def instance_method(self):
self.show = "instance"
@classmethod
def class_method(cls):
return cls()
@staticmethod
def static_method():
return ClassType()
def print_type(self):
print(self.show)
class InheritedClassType(ClassType):
type = "inherited"
a = InheritedClassType.static_method()
b = InheritedClassType.class_method()
c = ClassType()
d = InheritedClassType()
a.print_type()
b.print_type()
c.print_type()
c.instance_method()
c.print_type()
d.print_type()
d.instance_method()
d.print_type()