Python Introspection: A Description of the Parameters That a Function Executes

Is there a tool like dir() for modules that will tell me what parameters this function performs? For example, I would like to do something like dir(os.rename) and tell it which parameters are documented so that I can avoid checking the documentation on the Internet and instead use only the Python scripting interface for this.

+7
python introspection
source share
2 answers

help(thing) pretty prints all docstrings that are in the module, method, regardless ...

+4
source share

I understand that you are more interested in help(thing) or thing.__doc__ , but if you are trying to do programmatic introspection (instead of human-readable documentation) to find out about the function call, you can use the inspect module , as discussed in this question .

+10
source share

All Articles