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")