bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / _core / _multiarray_umath / _add_newdoc_ufunc
built-in
numpy._core._multiarray_umath:_add_newdoc_ufunc
Signature
add_ufunc_docstring ( ufunc , new_docstring ) Summary
Replace the docstring for a ufunc with new_docstring. This method will only work if the current docstring for the ufunc is NULL. (At the C level, i.e. when ufunc->doc is NULL.)
Parameters
ufunc: numpy.ufuncA ufunc whose current doc is NULL.
new_docstring: stringThe new docstring for the ufunc.
Notes
This method allocates memory for new_docstring on the heap. Technically this creates a memory leak, since this memory will not be reclaimed until the end of the program even if the ufunc itself is removed. However this will only be a problem if the user is repeatedly creating ufuncs with no documentation, adding documentation via add_newdoc_ufunc, and then throwing away the ufunc.
Aliases
-
numpy._core._multiarray_umath._add_newdoc_ufunc