_oninstance__wrapped age though calls by name work normally break privacy to view result in other wordsthis is matter of built-in operations versus explicit callsit has little to do with the actual names of the methods involved just for built-in operationspython skips step for ' new-style classes using the alternative __getattribute__ method won' help here--although it is defined to catch every attribute reference (not just undefined names)it is also not run by builtin operations python' property featurewhich we met in won' help directly here eitherrecall that properties are automatically run code associated with specific attributes defined when class is writtenand are not designed to handle arbitrary attributes in wrapped objects approaches to redefining operator overloading methods for as mentioned earlierthe most straightforward solution under is to redundantly redefine operator overloading names that may appear in embedded objects in delegation-based classes like our decorator this isn' ideal because it creates some code redundancyespecially compared to solutions howeverit isn' an impossibly major coding effortcan be automated to some extent with tools or superclassessuffices to make our decorator work in xand may allow operator overloading names to be declared private or public tooassuming overloading methods trigger the failif test internally inline definition for instancethe following is an inline redefinition approach--add method redefinitions to the proxy for every operator overloading method wrapped object may define itselfto catch and delegate we're adding just four operation interceptors to illustratebut others are similar (new code is in bold font here)def accesscontrol(failif)def ondecorator(aclass)class oninstancedef __init__(self*args**kargs)self __wrapped aclass(*args**kargsintercept and delegate built-in operations specifically def __str__(self)return str(self __wrappeddef __add__(selfother)return self __wrapped other or getattr( '__add__')(ydef __getitem__(selfindex)return self __wrapped[indexif needed def __call__(self*args**kargs)return self __wrapped(*args**kargsif needed plus any others needed intercept and delegate by-name attribute access generically def __getattr__(selfattr)def __setattr__(selfattrvalue) decorators