Function argument conformity check

dlists.cad at gmail.com dlists.cad at gmail.com
Wed Jun 18 14:19:12 EDT 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.

Thanks.



More information about the Python-list mailing list