numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
deprecate(*args, **kwargs)

This function may also be used as a decorator.

Parameters

func : function

The function to be deprecated.

old_name : str, optional

The name of the function to be deprecated. Default is None, in which case the name of :None:None:`func` is used.

new_name : str, optional

The new name for the function. Default is None, in which case the deprecation message is that :None:None:`old_name` is deprecated. If given, the deprecation message is that :None:None:`old_name` is deprecated and :None:None:`new_name` should be used instead.

message : str, optional

Additional explanation of the deprecation. Displayed in the docstring after the warning.

Returns

old_func : function

The deprecated function.

Issues a DeprecationWarning, adds warning to :None:None:`old_name`'s docstring, rebinds old_name.__name__ and returns the new function object.

Examples

Note that olduint returns a value after printing Deprecation Warning:

>>> olduint = np.deprecate(np.uint)
DeprecationWarning: `uint64` is deprecated! # may vary
>>> olduint(6)
6
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.lib.utils.deprecate_with_doc numpy.lib.utils._Deprecate

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/lib/utils.py#144
type: <class 'function'>
Commit: