howto check is function capable of obtaining **kwargs?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Mon Jul 21 11:22:44 CEST 2008


dmitrey a écrit :
> hi all,
> howto check is function capable of obtaining **kwargs?
> 
> i.e. I have some funcs like
> def myfunc(a,b,c,...):...
> 
> some like
> def myfunc(a,b,c,...,*args):...
> 
> some like
> def myfunc(a,b,c,...,*args, **kwargs):...
> 
> some like
> def myfunc(a,b,c,...,zz=zz0):...
> 
> So I need to know is the given function capable of handling zz
> parameter, for example the call
> myfunc(a,b,c,...,zz=4,...)

inspect.getargspecs should give you the answer.




More information about the Python-list mailing list