Awesome, wrapping that into a function:

def getargs(func):
    numArgs = func.func_code.co_argcount
    names = func.func_code.co_varnames
    return names[:numArgs]

short, concise, and it works :)

variables declared inside the function body are also in co_varnames
but after the arguments only it seems

A good module (huge, very comprehensive)
for this kinda thing can be found at:

http://lfw.org/python/inspect.py

Thanks very much!
-Dan


-- http://mail.python.org/mailman/listinfo/python-list

Reply via email to