in a multiple inheritance setting such as laid out in, how can I use super() and also handle the case when the signature of the function changes between classes in
Please see the following code, does this answer your question?
class A():
def __init__(self, *args, **kwargs):
print("A")
class B():
def __init__(self, *args, **kwargs):
print("B")
class C(A):
def __init__(self, *args, **kwargs):
print("C","arg=", *args)
super().__init__(self, *args, **kwargs)
class D(B):
def __init__(self, *args, **kwargs):
print("D", "arg=", *args)
super().__init__(self, *args, **kwargs)
class E(C,D):
def __init__(self, *args, **kwargs):
print("E", "arg=", *args)
super().__init__(self, *args, **kwargs)
# now you can call the classes with a variable amount of arguments
# which are also delegated to the parent classed through the super() calls
a = A(5, 5)
b = B(4, 4)
c = C(1, 2, 4, happy=True)
d = D(1, 3, 2)
e = E(1, 4, 5, 5, 5, 5, value=4)