Inheritance diagram for IPython.OInspect:
Tools for inspecting Python objects.
Uses syntax highlighting for presenting the various information elements.
Similar in spirit to the inspect module, but all calls take a name argument to reference the name under which an object is being read.
Generic message when no information is found.
Print the definition header for any callable object.
If the object is a class, print the constructor information.
Print the docstring for any object.
Optional: -formatter: a function to run the docstring through for specially formatted docstrings.
Show the whole file where an object was defined.
Show detailed information about an object.
Search namespaces with wildcards for objects.
searches and optionally a type specification to narrow the search to objects of that type.
- ns_search: list of namespace names to include in search.
- ignore_case(False): make the search case-insensitive.
- show_all(False): show all names, including those starting with
Print the source code for an object.
Get the names and default values of a function’s arguments.
A tuple of four things is returned: (args, varargs, varkw, defaults). ‘args’ is a list of the argument names (it may contain nested lists). ‘varargs’ and ‘varkw’ are the names of the * and ** arguments or None. ‘defaults’ is an n-tuple of the default values of the last n arguments.
Modified version of inspect.getargspec from the Python Standard Library.
Stable wrapper around inspect.getdoc.
This can’t crash because of attribute problems.
It also attempts to call a getdoc() method on the given object. This allows objects which provide their docstrings via non-standard mechanisms (like Pyro proxies) to still be inspected by ipython’s ? system.
Wrapper around inspect.getsource.
This can be modified by other projects to provide customized source extraction.
This implementation will skip returning any output for binary objects, but custom extractors may know how to meaningfully process them.