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

    Four things are returned: (args, varargs, kwonlyargs, varkw), where
    'args' and 'kwonlyargs' are lists of argument names, and '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 _getfullargs(co):
    """Get information about the arguments accepted by a code object.

    Four things are returned: (args, varargs, kwonlyargs, varkw), where
    'args' and 'kwonlyargs' are lists of argument names, and 'varargs'
    and 'varkw' are the names of the * and ** arguments or None."""

    if not iscode(co):
        if hasattr(len, '__code__') and type(co) is type(len.__code__):
            # PyPy extension: built-in function objects have a __code__
            # too.  There is no co_code on it, but co_argcount and
            # co_varnames and co_flags are present.
            pass
        else:
            raise TypeError('{!r} is not a code object'.format(co))

    nargs = co.co_argcount
    names = co.co_varnames
    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 args, varargs, kwonlyargs, varkw
def _getfullargs ( co ) : if not iscode ( co ) : if hasattr ( len , '__code__' ) and type ( co ) is type ( len . __code__ ) : # PyPy extension: built-in function objects have a __code__ # too.  There is no co_code on it, but co_argcount and # co_varnames and co_flags are present. pass else : raise TypeError ( '{!r} is not a code object' . format ( co ) ) nargs = co . co_argcount names = co . co_varnames 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 args , varargs , kwonlyargs , varkw