Add @type_check_only to various typeshed-only procotols in stdlib (#14465)

Mark various typeshed-only protocols as `@type_check_only` in stdlib
This commit is contained in:
Brian Schubert
2025-07-26 15:02:17 -04:00
committed by GitHub
parent e2d0c451e2
commit f88a09d479
15 changed files with 42 additions and 19 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ from builtins import list as _list, type as _type
from collections.abc import Iterable, Iterator, Mapping
from email.message import Message
from types import TracebackType
from typing import IO, Any, Protocol
from typing import IO, Any, Protocol, type_check_only
from typing_extensions import Self
__all__ = [
@@ -31,7 +31,7 @@ def parse(
def parse_multipart(
fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = "utf-8", errors: str = "replace", separator: str = "&"
) -> dict[str, list[Any]]: ...
@type_check_only
class _Environ(Protocol):
def __getitem__(self, k: str, /) -> str: ...
def keys(self) -> Iterable[str]: ...