Skip to content

Return type annotation is collapsed when no name is given #659

@edabor

Description

@edabor

When parsing documentation docstrings, not specifying the returned variable name with multiple return types (ie. float or None or float | None), induces that the rendered documentation is removing all spaces between annotations.

See the example below taken from pyvista where we use the numpydoc sphinx extension https://docs.pyvista.org/api/utilities/_autosummary/pyvista.get_array.html#pyvista.get_array
Image

This led us to add return parameter name all over the place as a workaround in pyvista/pyvista#8081, thereby excluding RT02 rule.

Is there another workaround ? Is this a parsing bug ?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions