Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecated is becoming an official decorator #70

Open
12rambau opened this issue Mar 8, 2024 · 4 comments
Open

deprecated is becoming an official decorator #70

12rambau opened this issue Mar 8, 2024 · 4 comments

Comments

@12rambau
Copy link
Contributor

12rambau commented Mar 8, 2024

I just wanted to notify you that PEP-702 introduces support for an official @deprecated() decorator (https://peps.python.org/pep-0702/).

Are you planning on relying on it for the deprecated decorator ?

@bswck
Copy link

bswck commented Mar 16, 2024

In other words, the @deprecated decorator is now officially deprecated.

@12rambau
Copy link
Contributor Author

no not exactly as the deprecated decorator they introduced is not setting the version reason and is not compatible with Sphinx which to me are 2 huge downgrades. It goes without saying that versionadded and versionmodified remain completely not deprecated.

@dimaqq
Copy link

dimaqq commented Jun 12, 2024

I'm in the market for @deprecated backport, but it has to have same (or compatible) signature to the upcoming Py 3.13 version.

@flying-sheep
Copy link

flying-sheep commented Nov 21, 2024

A backport exists: https://github.com/python/typing_extensions/blob/main/CHANGELOG.md#release-490-december-9-2023

diff --git a/pyproject.toml b/pyproject.toml
index cfb7ffd2..324c4c42 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -66,6 +66,7 @@ dependencies = [
     "...",
+    "typing-extensions; python_version < '3.13'",
 ]

and then

if sys.version_info >= (3, 13):
    from warnings import deprecated
else:
    from typing_extensions import deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants