yagyala wrote: > Hi. I would like to be able to tell, at run time, how many parameters > a function requires. Ideally I would like to be able to tell which are > optional as well. I've tried looking at the functions attributes, but > haven't found one that helps in this. How can I do this? > > Thanks >
py> def doit(a, b, c, x=14): ... pass ... py> doit.func_code.co_argcount 4 py> doit.func_code.co_varnames ('a', 'b', 'c', 'x') py> doit.func_defaults (14,) James -- http://mail.python.org/mailman/listinfo/python-list