Lee Harr wrote: > I am trying to get some information about a function > before (and without) calling it.
If you allow for the function arguments to be evaluated it's easy (requires Python 2.7): >>> import inspect >>> def get_args(*args, **kw): ... return args, kw ... >>> argstr = "1, 2, z=42" >>> def f(a, b, x=1, y=2, z=3): ... pass ... >>> args, kw = eval("get_args(%s)" % argstr) >>> inspect.getcallargs(f, *args, **kw) {'a': 1, 'x': 1, 'b': 2, 'z': 42, 'y': 2} -- http://mail.python.org/mailman/listinfo/python-list