sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

Add support for PEP 695's explicit type aliases

Open cspotcode opened this issue 2 years ago • 6 comments
trafficstars

Is your feature request related to a problem? Please describe.

sphinx cannot document typing.TypeAliasType nor typing_extensions.TypeAliasType.

https://peps.python.org/pep-0695/

Describe the solution you'd like

automodule should document exported TypeAliasTypes without needing a preceding #: comment, the same way that classes and functions do not need a preceding #:.

References to such a type used in the signatures of other functions, types, classes, etc should hyperlink to the type's declaration, the same way that references to a class will hyperlink to the declaration of that class.

The declaration should render similar to how older style type aliases render today, saying "alias of ..."

Describe alternatives you've considered

Additional context

https://github.com/sphinx-doc/sphinx/issues/8934 https://github.com/sphinx-doc/sphinx/issues/11438

cspotcode avatar Aug 07 '23 20:08 cspotcode