runtime-info about a function-object

Mark McEahern marklists at mceahern.com
Mon Aug 19 12:12:31 EDT 2002


> Is it possible to request info about function-object "f",
>  especially about the number/name/defaults of arguments
>  that f accepts ?

>>> dir(f)
>>> dir(f.func_code)
>>> print f.func_code.co_argcount
>>> print f.func_code.co_varnames

etc.

// m
-





More information about the Python-list mailing list