def get_method_name ( method ) : name = get_object_name ( method ) if name . startswith ( "__" ) and not name . endswith ( "__" ) : name = "_{0}{1}" . format ( get_object_name ( method . im_class ) , name ) return name
how to get method name python
Returns given method name .
def get_method_name(method):
    """
    Returns given method name.

    :param method: Method to retrieve the name.
    :type method: object
    :return: Method name.
    :rtype: unicode
    """

    name = get_object_name(method)
    if name.startswith("__") and not name.endswith("__"):
        name = "_{0}{1}".format(get_object_name(method.im_class), name)
    return name