def echo_instancemethod(klass, method, write=sys.stdout.write):
 mname = method_name(method)
 never_echo = ('__str__', '__repr__')
 if (mname in never_echo):
  pass
 elif is_classmethod(method, klass):
  setattr(klass, mname, classmethod(echo(method.__func__, write)))
 else:
  setattr(klass, mname, echo(method, write))

def echo_instancemethod ( klass , method , write = sys . stdout . write ) : mname = method_name ( method ) never_echo = ( '__str__' , '__repr__' ) if ( mname in never_echo ) : pass elif is_classmethod ( method , klass ) : setattr ( klass , mname , classmethod ( echo ( method . __func__ , write ) ) ) else : setattr ( klass , mname , echo ( method , write ) )
change an instancemethod so that calls to it are echoed .