class A: def __init__(self): self.a = 1 self.b = 2 def foo(self): print("Hello") def __getattr__(self, name): print(f"Called __getattr__ with arg: {name}") return name