Calling method with arguments using __getattr__()
Recently, I saw the code below as an answer to a problem: class Proxy: def __init__(self, obj): self._obj = obj def __getattr__(self, attr): try: value = getattr(self._obj, attr) except Exception: raise Exception(‘No Such Method’) else: return value class Tmp: def __init__(self, num): self.num = num def set_num(self, num): self.num = num print(self.num) tmp = Tmp(10)… Read More Calling method with arguments using __getattr__()