Skip to content

DOC: In ufunc class documentation the identity attribute points to the identity() function #32532

Closed

Description

@eerovaher

Issue with current documentation:

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.

Activity

  1. lazerg commented on Sep 7, 2026

    @lazerg
    Contributor

    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.

    I opened numpy/numpydoc#706 to make those targets class-specific.

  2. InessaPawson commented on Sep 13, 2026

    @InessaPawson
    Member

    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 ufunc page renders correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions