if you've been reading this book linearlysome of this section is review and elaboration on material covered earlierespecially in for othersthis topic is presented in this context here when introduced __getattr__ and __getattribute__i stated that they intercept undefined and all attribute fetchesrespectivelywhich makes them ideal for delegationbased coding patterns while this is true for both normally named and explicitly called attributestheir behavior needs some additional clarificationfor method-name attributes implicitly fetched by built-in operationsthese methods may not be run at all this means that operator overloading method calls cannot be delegated to wrapped objects unless wrapper classes somehow redefine these methods themselves for exampleattribute fetches for the __str____add__and __getitem__ methods run implicitly by printingexpressionsand indexingrespectivelyare not routed to the generic attribute interception methods in specificallyin python xneither __getattr__ nor __getattribute__ is run for such attributes in python classic classes__getattr__ is run for such attributes if they are undefined in the class in python x__getattribute__ is available for new-style classes only and works as it does in in other wordsin all python classes (and new-style classes)there is no direct way to generically intercept built-in operations like printing and addition in python ' default classic classesthe methods such operations invoke are looked up at runtime in instanceslike all other attributesin python ' new-style classes such methods are looked up in classes instead since mandates new-style classes and defaults to classicthis is understandably attributed to xbut it can happen in new-style code too in xthoughyou at least have way to avoid this changein xyou do not per the official (though tersely documentedrationale for this change appears to revolve around metaclassses and optimization of built-in operations regardlessgiven that all attributes--both normally named and others--still dispatch generically through the instance and these methods when accessed explicitly by namethis does not seem meant to preclude delegation in generalit seems more an optimization step for built-in operationsimplicit behavior this doeshowevermake delegationbased coding patterns more complex in xbecause object interface proxies cannot generically intercept operator overloading method calls and route them to an embedded object this is an inconveniencebut is not necessarily showstopper--wrapper classes can work around this constraint by redefining all relevant operator overloading methods in the wrapper itselfin order to delegate calls these extra methods can be added either __getattr__ and __getattribute__