We have a two classes declared as follows
Class A
class A:
def __init__(self,a)
self.a = a
and class B
class B:
def __init__(self,B)
self.b = b
We want to create a class C that inherits both classes A and B
class C(A,B):
def __init__(self,a,b)
pass
I want when creating C to use the constructors of both A and B at the same time from the body of C. How can I use the constructors of both parent classes to set values of a and b from the constructor of the child class that inherits both. All solution I see speak about just about the scenario that calls only one constructor using super(C,self).__init__
Even it is not so true, I speak about a scenario like this
class C(A,B):
def __init__(self,a,b)
A.__init__(a)
B.__init__(b)
I want to pass arguments separately to the constructors of the super classes. What is the best Pythonic way to do this ?