print(x__str__ spam class (object)rest of class unchanged classic doesn' inherit default new-style in and (built-ins not routed to getattr [ typeerror'cobject does not support indexing print(xthough apparently rationalized in the name of class metaclass methods and optimizing built-in operationsthis divergence is not addressed by special-casing normal instances having __getattr__and applies only to built-in operations--not to normally named methodsor explicit calls to built-in methods by nameclass cpass ( normal lambda normal( __add__ lambda( ) __add__( classic class class (object)pass / new-style class ( normal lambda normal(normals still from instance __add__ lambda( ) __add__( ditto for explicit built-in names typeerrorunsupported operand type(sfor +'cand 'intthis behavior winds up being inherited by the __getattr__ attribute interception methodclass (object)def __getattr__(selfname)print(namex ( normal normal names are still routed to getattr normal __add__ direct calls by name are toobut expressions are not__add__ typeerrorunsupported operand type(sfor +'cand 'intnew-style class changes