numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParameters
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.

Notes

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:

If possible it should be avoided.

Parameters

place : str

The absolute name of the module to import from

obj : str

The name of the object to add documentation to, typically a class or function name

doc : {str, Tuple[str, str], List[Tuple[str, str]]}

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), ...]

warn_on_python : bool

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

Examples

See :

Local connectivity graph

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


GitHub : /numpy/core/function_base.py#475
type: <class 'function'>
Commit: