default classic classesbecause operator overloading attributes are routed through this methodand such classes do not inherit default for __repr__c:\codepy - getattr-delegate py jones [personsue jones jones [persontom jones switching to __getattribute__ won' help here either--like __getattr__it is not run for operator overloading attributes implied by built-in operations in either python or xreplace __getattr_ with __getattribute__ class manager(object)def __init__(selfnamepay)self person person(name'mgr'paydef giveraise(selfpercentbonus )self person giveraise(percent bonusdef __getattribute__(selfattr)print('**'attrif attr in ['person''giveraise']return object __getattribute__(selfattrelsereturn getattr(self personattruse "(object)in embed person object intercept and delegate fetch my attrs delegate all others regardless of which attribute interception method is used in xwe still must include redefined __repr__ in manager (as shown previouslyin order to intercept printing operations and route them to the embedded person objectc:\codepy - getattr-delegate py jones [personsue jones *lastname *person jones *giveraise *person notice that __getattribute__ gets called twice here for methods--once for the method nameand again for the self person embedded object fetch we could avoid that with different codingbut we would still have to redefine __repr__ to catch printingalbeit differently here (self person would cause this __getattribute__ to fail)code __getattribute__ differently to minimize extra calls class managerdef __init__(selfnamepay)self person person(name'mgr'paydef __getattribute__(selfattr)print('**'attrperson object __getattribute__(self'person'__getattr__ and __getattribute__