Skip to content

Improve rendering of ReST directives in docstrings #2147

@AlexWaygood

Description

@AlexWaygood

Summary

For example, the stdlib method logging.Filterer.filter has several ReST directives at the bottom of its docstring that tell you when the API was updated: https://github.com/astral-sh/ruff/blob/b4c2825afdd8c1010c3a5859521629d2d1e0a6df/crates/ty_vendored/vendor/typeshed/stdlib/logging/__init__.pyi#L136-L142. Pylance renders these as sentences that use English words:

Image

And Sphinx renders them similarly in CPython's online HTML documentation:

Image

But we currently just render these as "versionchanged:: 3.2":

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions