mro in python

Solutions on MaxInterview for mro in python by the best coders in the world

showing results for - "mro in python"
Alessandra
15 Sep 2019
1class A:
2  def method(self):
3    print("A.method() called")
4
5class B(A):
6  def method(self):
7    print("B.method() called")
8
9b = B()
10b.method()
Christopher
24 Jul 2020
1class A:
2  def method(self):
3    print("A.method() called")
4
5class B:
6  def method(self):
7    print("B.method() called")
8
9class C(A, B):
10  pass
11
12class D(C, B):
13  pass
14
15d = D()
16d.method()
Romina
17 Aug 2020
1class A:
2  def method(self):
3    print("A.method() called")
4
5class B:
6  pass
7
8class C(B, A):
9  pass
10
11c = C()
12c.method()