From aeeb31fd883e3d1b601cadf32230b949679d35f7 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 7 Nov 2023 19:55:56 -0800 Subject: [PATCH] @deprecated: will be in warnings, not typing --- doc/index.rst | 2 +- src/typing_extensions.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 39885861..3bbe2fc8 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -549,7 +549,7 @@ Decorators .. decorator:: deprecated(msg, *, category=DeprecationWarning, stacklevel=1) - See :pep:`702`. Experimental; not yet part of the standard library. + See :pep:`702`. In the :mod:`warnings` module since Python 3.13. .. versionadded:: 4.5.0 diff --git a/src/typing_extensions.py b/src/typing_extensions.py index c8c6853b..fc656de8 100644 --- a/src/typing_extensions.py +++ b/src/typing_extensions.py @@ -2282,8 +2282,8 @@ def method(self) -> None: return arg -if hasattr(typing, "deprecated"): - deprecated = typing.deprecated +if hasattr(warnings, "deprecated"): + deprecated = warnings.deprecated else: _T = typing.TypeVar("_T")