This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / _core / _multiarray_umath / _add_newdoc_ufunc

built-in

numpy._core._multiarray_umath:_add_newdoc_ufunc

Signature

built-in 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.ufunc

A ufunc whose current doc is NULL.

new_docstring : string

The 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