From b20fa2c7d0af09701cb7786445f33cee03cf933d Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 11 Aug 2022 11:24:15 +0100 Subject: [PATCH] Add `@type_check_only` to a few fictional classes in `builtins.pyi` --- stdlib/builtins.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 3f2271d468c4..1bcd4746c7a3 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -53,6 +53,7 @@ from typing import ( # noqa: Y027 SupportsRound, TypeVar, overload, + type_check_only, ) from typing_extensions import Literal, LiteralString, SupportsIndex, TypeAlias, TypeGuard, final @@ -938,6 +939,7 @@ class tuple(Sequence[_T_co], Generic[_T_co]): # Doesn't exist at runtime, but deleting this breaks mypy. See #2999 @final +@type_check_only class function: # Make sure this class definition stays roughly in line with `types.FunctionType` @property @@ -1773,6 +1775,7 @@ def __build_class__(__func: Callable[[], _Cell | Any], __name: str, *bases: Any, # Actually the type of Ellipsis is , but since it's # not exposed anywhere under that name, we make it private here. @final +@type_check_only class ellipsis: ... Ellipsis: ellipsis