Function argument conformity check

dlists.cad at dlists.cad at
Wed Jun 18 20:19:12 CEST 2008

Hi. I am looking for a way to check if some given set of (*args,
**kwds) conforms to the argument specification of a given function,
without calling that function.

For example, given the function foo:
def foo(a, b, c): pass

and some tuple args and some dict kwds, is there a way to tell if i
_could_ call foo(*args, **kwds) without getting an exception for those
arguments? I am hoping there is a way to do this without actually
writing out the argument logic python uses.


More information about the Python-list mailing list