def addStr(anInstance): anInstance.__str__ = new.instancemethod(__str__, anInstance, anInstance.__class__) # Test it