return lambda percentperson giveraise(percent elsereturn getattr(personattrdef __repr__(self)person object __getattribute__(self'person'return str(personwhen this alternative runsour object prints properlybut only because we've added an explicit __repr__ in the wrapper--this attribute is still not routed to our generic attribute interception methodjones [personsue jones *lastname jones *giveraise [persontom jones that short story here is that delegation-based classes like manager must redefine some operator overloading methods (like __repr__ and __str__to route them to embedded objects in python xbut not in python unless new-style classes are used our only direct options seem to be using __getattr__ and python xor redefining operator overloading methods in wrapper classes redundantly in againthis isn' an impossible taskmany wrappers can predict the set of operator overloading methods requiredand tools and superclasses can automate part of this task--in factwe'll study coding patterns that can fill this need in the next moreovernot all classes use operator overloading methods (indeedmost application classes usually should notit ishoweversomething to keep in mind for delegation coding models used in python xwhen operator overloading methods are part of an object' interfacewrappers must accommodate them portably by redefining them locally exampleattribute validations to close out this let' turn to more realistic examplecoded in all four of our attribute management schemes the example we will use defines cardholder object with four attributesthree of which are managed the managed attributes validate or transform values when fetched or stored all four versions produce the same results for the same test codebut they implement their attributes in very different ways the examples are included largely for self-studyalthough won' go through their code in detailthey all use concepts we've already explored in this using properties to validate our first coding in the file that follows uses properties to manage three attributes as usualwe could use simple methods instead of managed attributesbut properties help managed attributes