Checking if a function invocation will throw a TypeError?

Andrey Fedorov anfedorov at
Thu Oct 29 19:43:19 CET 2009

Is there a standard function that will check whether certain *args, and
**kwargs satisfy a argspec of a function (s.t. it does not throw a
TypeError). Say:

def foo(a,b=1):

check(foo, 1,2) # True
check(foo, 1) # True
check(foo) # False
check(foo, 1, a=2) # False

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list