Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Return a nicely-formatted source-like signature, formatted from an
argspec.

        def signature(argspec):
    """Return a nicely-formatted source-like signature, formatted from an
    argspec.
    """
    regargs, kwargs = getBetterThanArgspec(argspec)
    varargname, varkwname = argspec[1:3]
    things = []
    for regarg in regargs:
        if isinstance(regarg, list):
            things.append(_strtup(regarg))
        else:
            things.append(regarg)
    if varargname:
        things.append('*%s' % varargname)
    things += ['%s=%s' % (t[0], t[1]) for t in kwargs]
    if varkwname:
        things.append('**%s' % varkwname)
    return ', '.join(things)
        


src/p/y/pydoctor-0.5/pydoctor/test/test_formatting.py   pydoctor(Download)
def test_strsig():
    argspec = [['a', 'b', 'c'], None, None, (1,2)]
    assert html.signature(argspec) == "a, b=1, c=2"
 
def test_strsigvar():
    argspec = [['a', 'b', 'c'], 'args', 'kk', (1,2)]
    assert html.signature(argspec) == "a, *args, b=1, c=2, **kk"
def test_strsigargh():
    argspec = [['a', ['b','c']], None, None, ()]
    assert html.signature(argspec) == 'a, (b, c)'
 
def test_link():