(spec)
return spec[2:pos]
Private helper to get first parameter name from a
    __text_signature__ of a builtin method, which should
    be in the following format: '($param1, ...)'.
    Assumptions are that the first argument won't have
    a default value or an annotation.
Private helper to get first parameter name from a
    __text_signature__ of a builtin method, which should
    be in the following format: '($param1, ...)'.
    Assumptions are that the first argument won't have
    a default value or an annotation.
Private helper to get first parameter name from a __text_signature__ of a builtin method which should be in the following format : ( $param1 ... ) . Assumptions are that the first argument won t have a default value or an annotation .
def _signature_get_bound_param(spec):
    """ Private helper to get first parameter name from a
    __text_signature__ of a builtin method, which should
    be in the following format: '($param1, ...)'.
    Assumptions are that the first argument won't have
    a default value or an annotation.
    """

    assert spec.startswith('($')

    pos = spec.find(',')
    if pos == -1:
        pos = spec.find(')')

    cpos = spec.find(':')
    assert cpos == -1 or cpos > pos

    cpos = spec.find('=')
    assert cpos == -1 or cpos > pos

    return spec[2:pos]
def _signature_get_bound_param ( spec ) : assert spec . startswith ( '($' ) pos = spec . find ( ',' ) if pos == - 1 : pos = spec . find ( ')' ) cpos = spec . find ( ':' ) assert cpos == - 1 or cpos > pos cpos = spec . find ( '=' ) assert cpos == - 1 or cpos > pos return spec [ 2 : pos ]