must be made new-style by deriving from object to use this method this code' object derivation is optional in because all classes are new-style when run under python xthoughresults for __getattr__ differ--none of the implicitly run operator overloading methods trigger either attribute interception method when their attributes are fetched by built-in operations python (and new-style classes in generalskips the normal instance lookup mechanism when resolving such namesthough normally named methods are still intercepted as beforec:\codepy - getattr-builtins py getattr==========================================getattrother __len__ fail [fail fail (getattr__call__ getattribute=====================================getattributeeggs getattributespam getattributeother __len__ fail [fail fail (getattribute__call__ getattribute__str__ [getattribute strtrace these outputs back to prints in the script to see how this works some highlights__str__ access fails to be caught twice by __getattr__ in xonce for the built-in printand once for explicit fetches because default is inherited from the class (reallyfrom the built-in objectwhich is an automatic superclass to every class in x__str__ fails to be caught only once by the __getattribute__ catchallduring the built-in print operationexplicit fetches bypass the inherited version __call__ fails to be caught in both schemes in for built-in call expressionsbut it is intercepted by both when fetched explicitlyunlike __str__there is no inherited __call__ default for object instances to defeat __getattr__ __len__ is caught by both classessimply because it is an explicitly defined method in the classes themselves--though its name it is not routed to either __getattr__ or __getattribute__ in if we delete the class' __len__ methods all other built-in operations fail to be intercepted by both schemes in managed attributes