Skip to content

Support PEP 702 to register deprecations with autdoc #11963

Closed

Description

@saulshanabrook

Is your feature request related to a problem? Please describe.
I am currently using PEP 702 to mark functions and classes as deprecated in Python, like this:

from typing_extensions import deprecated

@deprecated("This function isn't used anymore. Instead use XYZ")
def f(): pass

However, that information does not show up in sphinx when I autodoc the functions/classes, so users are not aware that they are from looking at the docs.

Describe the solution you'd like

It would be great if the deprecated directive would be added to classes, functions, and overloaded functions that are tagged with this decorator.

Describe alternatives you've considered
Instead, for now I can manually add that to the docstring as well.

Additional context

Activity

  1. changed the title [-]Support PEP 702 to register deprecations with autdo[/-] [+]Support PEP 702 to register deprecations with autdoc[/+] on Feb 6, 2024
  2. locked and limited conversation to collaborators on Apr 28, 2024
  3. converted this issue into a discussion #12334 on Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions