numpy.
deprecate
Issues a DeprecationWarning, adds warning to old_name’s docstring, rebinds old_name.__name__ and returns the new function object.
old_name.__name__
This function may also be used as a decorator.
The function to be deprecated.
The name of the function to be deprecated. Default is None, in which case the name of func is used.
The new name for the function. Default is None, in which case the deprecation message is that old_name is deprecated. If given, the deprecation message is that old_name is deprecated and new_name should be used instead.
Additional explanation of the deprecation. Displayed in the docstring after the warning.
The deprecated function.
Examples
Note that olduint returns a value after printing Deprecation Warning:
olduint
>>> olduint = np.deprecate(np.uint) DeprecationWarning: `uint64` is deprecated! # may vary >>> olduint(6) 6