This code shows error: AttributeError: 'super' object has no attribute 'method'
this same code does not shows error when "super.method()" is removed in class C. Why?
class A(object):
def method(self):
print("\n class A method")
super().method()
class B(object):
def method(self):
print("\n class B method")
super().method()
class C(object):
def method(self):
print("\n class C method")
super().method()
class X(A, B):
def method(self):
print("\n class X method")
super().method()
class Y(B, C):
def method(self):
print("\n class Y method")
super().method()
class P(X, Y, C):
def method(self):
print("\n class P method")
super().method()
p = P()
p.method()
print(P.mro())
I want to know, why this program is showing errors when "super().method" is included in class C, and why this same program is NOT SHOWING ERROR, when "super().method" is removed in class C?