ty
ty copied to clipboard
Improve rendering of ReST directives in docstrings
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:
And Sphinx renders them similarly in CPython's online HTML documentation:
But we currently just render these as "versionchanged:: 3.2":