Self descibing scripts

Michael Hudson mwh21 at cam.ac.uk
Mon Apr 2 10:53:42 EDT 2001


"Neil Benn" <neil.benn at cambridgeantibody.com> writes:

>             Oooo, thanks Fredrik, that's close - the only problem is
> that it doesn't return parameters required for the methods.  D'ya
> know if it is possible to do that?

Depends a bit what you want.  Python has default arguments, * and **
style args and no static type information, so it's harder to give a
meaningful answer to your question.  You could try Ping's "inpect"
module, which is part of Python 2.1 but can also be found at

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

which has a "getargspec" function (amongst much other stuff!) that
gets all the information in a neat form.

Cheers,
M.

-- 
  The gripping hand is really that there are morons everywhere, it's
  just that the Americon morons are funnier than average.
                              -- Pim van Riezen, alt.sysadmin.recovery



More information about the Python-list mailing list