Imagine we have the following:
- Code: Select all
class A(object):
def m1(self):
pass
def m2(self):
pass
class B(object):
def __init__(self):
self.a = A()
What I need is to be able to call either A methods or B methods through B instance.
Smth like
- Code: Select all
def __getattribute__(self, name): # B method call
if condition:
# try call method from self.a
else:
# try call method from self
Hope I described clearly..


