Module (21%)
Section (50%)

Due to MRO, you should knowingly list the superclasses in the subclass definition. In the following example, class D is based on classes B and C, whereas class E is based on classes C and B (the order matters!).

class D(B, C): pass class E(C, B): pass

As a result, those classes can behave totally differently, because the order of the superclasses is different.


Code

class A:
def info(self):
print('Class A')

class B(A):
def info(self):
print('Class B')

class C(A):
def info(self):
print('Class C')

class D(B, C):
pass

class E(C, B):
pass

D().info()
E().info()
{{ dockerServerErrorMsg }} ×
{{ errorMsg }} ×
{{ successMsg }} ×