Inheritance diagram for IPython.core.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.
Compute a dict with detailed information about an object.
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.
In : %pdoc NoDoc No documentation found for NoDoc
In : %pdoc NoInit No documentation found for NoInit
In : obj = NoInit()
In : %pdoc obj No documentation found for obj
In : obj2 = NoDoc()
In : %pdoc obj2 No documentation found for obj2
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.
Extract call tip data from an oinfo dict.
oinfo : dict
format_call : bool, optional
call_info : None, str or (str, dict) tuple.
docstring : str or None
Format argspect, convenience wrapper around inspect’s.
This takes a dict instead of ordered arguments and calls inspect.format_argspec with the arguments in the necessary order.
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.
Make an object info dict with all fields present.