I'm trying to create a middle class that can execute the same function in two classes that have the same methods, passing the args and kwargs.
class B:
def random_func(self, i, j, test=None):
print(2)
class A:
def random_func(self, i, j, test=None):
print(1)
class MiddleClass:
a = A()
b = B()
def __getattribute__(self, attr, *args?, **kwargs?):
# How Do I get the *args, **kwargs?
self.a.attr(*args, **kwargs)
self.b.attr(*args, **kwargs)
return something_callable?
m = MiddleClass()
m.random_func(1, 3, test="hello")
Thank you!