add_newdoc(place, obj, doc, warn_on_python=True)
The purpose is to allow easier editing of the docstrings without requiring a re-compile. This exists primarily for internal use within numpy itself.
This routine never raises an error if the docstring can't be written, but will raise an error if the object being documented does not exist.
This routine cannot modify read-only docstrings, as appear in new-style classes or built-in functions. Because this routine never raises an error the caller must check manually that the docstrings were changed.
Since this function grabs the char *
from a c-level str object and puts it into the tp_doc
slot of the type of :None:None:`obj`
, it violates a number of C-API best-practices, by:
modifying a :None:None:`PyTypeObject`
after calling :None:None:`PyType_Ready`
calling :None:None:`Py_INCREF`
on the str and losing the reference, so the str will never be released
If possible it should be avoided.
The absolute name of the module to import from
The name of the object to add documentation to, typically a class or function name
If a string, the documentation to apply to :None:None:`obj`
If a tuple, then the first element is interpreted as an attribute of :None:None:`obj`
and the second as the docstring to apply - (method, docstring)
If a list, then each element of the list should be a tuple of length two - [(method1, docstring1), (method2, docstring2), ...]
If True, the default, emit :None:None:`UserWarning`
if this is used to attach documentation to a pure-python object.
Add documentation to an existing object, typically one defined in C
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them