Why is the code output is different in python 2 and python 3?
class A:
def m(self):
print("m of A called")
class B(A):
pass
class C(A):
def m(self):
print("m of C called")
class D(B,C):
pass
x = D()
x.m()
Actual Output:
$ python diamond1.py //python 2 used for the code
m of A called
$ python3 diamond1.py //python 3 used for the code
m of C called
Can somebody tell how(the order of calling) are the methods (method m) being called and why and what is the difference in their implementation in python 2 and python 3?