[typing] Deprecate no_type_check_decorator (#15048)

This commit is contained in:
Semyon Moroz
2025-11-18 15:36:48 +04:00
committed by GitHub
parent 6387a6f9c1
commit 6b4e7f1246
+8 -4
View File
@@ -408,7 +408,13 @@ _TC = TypeVar("_TC", bound=type[object])
def overload(func: _F) -> _F: ...
def no_type_check(arg: _F) -> _F: ...
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; removed in Python 3.15.")
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
else:
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
# This itself is only available during type checking
def type_check_only(func_or_cls: _FT) -> _FT: ...
@@ -1000,9 +1006,7 @@ class NamedTuple(tuple[Any, ...]):
@overload
def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None: ...
@overload
@typing_extensions.deprecated(
"Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15"
)
@deprecated("Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15")
def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None: ...
@classmethod
def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ...