Sorry if this question has been asked before, I could not find the answer while searching other questions.
I'm new to Python and I'm having issues with multiple inheritance. Suppose I have 2 classes, B and C, which inherit from the same class A, which are defined as follows:
class B(A):
def foo():
...
return
def bar():
...
return
class C(A):
def foo():
...
return
def bar():
...
return
I now want to define another class D, which inherits from both B and C. D should inherit B's implementation of foo, but C's implementation of bar. How do I go about doing this?
D.__init__you canself.bar = C.barsuper().foo()in class D will callB.foo()onceBis beforeCin the mro__init__time.