def _getMethodNameInClass(method):
 if (getattr(method.im_class, method.__name__, object()) != method):
  for alias in dir(method.im_class):
   if (getattr(method.im_class, alias, object()) == method):
    return alias
 return method.__name__

def _getMethodNameInClass ( method ) : if ( getattr ( method . im_class , method . __name__ , object ( ) ) != method ) : for alias in dir ( method . im_class ) : if ( getattr ( method . im_class , alias , object ( ) ) == method ) : return alias return method . __name__
find the attribute name on the methods class which refers to the method .