function arguments

Robin Becker robin at jessikat.co.uk
Thu Jul 6 07:16:27 EDT 2000


In article <Pine.LNX.4.21.0007061257160.17492-100000 at krispc6.physik.uni-
karlsruhe.de>, Johannes Zellner <johannes at zellner.org> writes
>
>Hello,
>
>is there a way to get a functions argument list ?
>
>e.g.
>
>def fun(fred, lola):
>    ...
>
>something like `arglist(fun)' should return [ 'fred', 'lola' ]
>
def arglist(fun):
        return fun.func_code.co_varnames[:fun.func_code.co_argcount] 
-- 
Robin Becker



More information about the Python-list mailing list