Custom Search

Wednesday, March 9, 2016

python find function name, number of arguments, name of arguments and default values

>>>def mufunc(a,b,c=5,d=10):
            pass


>>>func = mufunc

>>>func.func_name

>>>func.func_code.co_varnames

>>>func.func_code.co_argcount

>>>func.func_defaults

OR

>>>func.__name__

>>>func.__code__.co_varnames

>>>func.__code__.co_argcount

>>>func.__defaults__




No comments:

Post a Comment