(co)
return Arguments(args + kwonlyargs, varargs, varkw)
Get information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where
    'args' is the list of argument names. Keyword-only arguments are
    appended. 'varargs' and 'varkw' are the names of the * and **
    arguments or None.
Get information about the arguments accepted by a code object.
Get information about the arguments accepted by a code object .
def getargs(co):
    """Get information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where
    'args' is the list of argument names. Keyword-only arguments are
    appended. 'varargs' and 'varkw' are the names of the * and **
    arguments or None."""
    if not iscode(co):
        raise TypeError('{!r} is not a code object'.format(co))

    names = co.co_varnames
    nargs = co.co_argcount
    nkwargs = co.co_kwonlyargcount
    args = list(names[:nargs])
    kwonlyargs = list(names[nargs:nargs+nkwargs])
    step = 0

    nargs += nkwargs
    varargs = None
    if co.co_flags & CO_VARARGS:
        varargs = co.co_varnames[nargs]
        nargs = nargs + 1
    varkw = None
    if co.co_flags & CO_VARKEYWORDS:
        varkw = co.co_varnames[nargs]
    return Arguments(args + kwonlyargs, varargs, varkw)
def getargs ( co ) : if not iscode ( co ) : raise TypeError ( '{!r} is not a code object' . format ( co ) ) names = co . co_varnames nargs = co . co_argcount nkwargs = co . co_kwonlyargcount args = list ( names [ : nargs ] ) kwonlyargs = list ( names [ nargs : nargs + nkwargs ] ) step = 0 nargs += nkwargs varargs = None if co . co_flags & CO_VARARGS : varargs = co . co_varnames [ nargs ] nargs = nargs + 1 varkw = None if co . co_flags & CO_VARKEYWORDS : varkw = co . co_varnames [ nargs ] return Arguments ( args + kwonlyargs , varargs , varkw )