[Tutor] Introspect function or class' required arguments

Kent Johnson kent37 at tds.net
Fri Dec 14 04:08:01 CET 2007


Luis N wrote:
> Is there a way to introspect a function or class' required arguments,
> particularly keyword arguments?

See inspect.getargspec() and formatargspec().
Look at the source if you want details of where the info is stored.

> I can easily use a dictionary since it is my own function that I wish
> to introspect. I haven't tested the below code yet, but e.g.

I don't understand what you are trying to do here.

Kent


More information about the Tutor mailing list