You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DOC: In ufunc class documentation the identity attribute points to the identity() function #32532
In the Attributes list of the ufunc class documentation the identity attribute erroneously links to the identity() function instead of the ufunc.identity attribute. The link has been wrong since at least version 1.20. The other attributes in that list point where they should, and all the links in the Attributes list of the Universal functions (ufunc) page are correct too.
The wrong link comes from numpydoc rather than from numpy. On a class page numpydoc writes every attribute of the Attributes list as :obj:`identity <identity>` , and Sphinx resolves that target against the current module before the current class, so it finds the numpy.identity function first. The other ufunc attributes have no function of the same name, so they resolve correctly.
Activity
lazerg commentedon Sep 7, 2026
The wrong link comes from numpydoc rather than from numpy. On a class page numpydoc writes every attribute of the Attributes list as
:obj:`identity <identity>`, and Sphinx resolves that target against the current module before the current class, so it finds thenumpy.identityfunction first. The otherufuncattributes have no function of the same name, so they resolve correctly.I opened numpy/numpydoc#706 to make those targets class-specific.
InessaPawson commentedon Sep 13, 2026
Thanks for the report @eerovaher, and thanks @lazerg for tracking this down and fixing it upstream!
Leaving this open until the pin update is merged to remember to verify the
ufuncpage renders correctly.