Skip to content

Commit 6b4e7f1

Browse files
authored
[typing] Deprecate no_type_check_decorator (#15048)
1 parent 6387a6f commit 6b4e7f1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

stdlib/typing.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,13 @@ _TC = TypeVar("_TC", bound=type[object])
408408

409409
def overload(func: _F) -> _F: ...
410410
def no_type_check(arg: _F) -> _F: ...
411-
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
411+
412+
if sys.version_info >= (3, 13):
413+
@deprecated("Deprecated since Python 3.13; removed in Python 3.15.")
414+
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
415+
416+
else:
417+
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
412418

413419
# This itself is only available during type checking
414420
def type_check_only(func_or_cls: _FT) -> _FT: ...
@@ -1000,9 +1006,7 @@ class NamedTuple(tuple[Any, ...]):
10001006
@overload
10011007
def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None: ...
10021008
@overload
1003-
@typing_extensions.deprecated(
1004-
"Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15"
1005-
)
1009+
@deprecated("Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15")
10061010
def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None: ...
10071011
@classmethod
10081012
def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ...

0 commit comments

Comments
 (0)