Add @type_check_only to stub-only private classes in stdlib (#14512)

This commit is contained in:
Brian Schubert authored and GitHub committed 2025-08-03 10:13:16 +02:00
1 parent dde70aeecd
commit 622df68c1c
61 files changed
+188 -51

No files matched your search

+2 -1
View File
@@ -9,7 +9,7 @@ from re import Pattern
from socket import SocketKind, socket
from threading import Thread
from types import TracebackType
from typing import Any, ClassVar, Final, Protocol, TypeVar
from typing import Any, ClassVar, Final, Protocol, TypeVar, type_check_only
from typing_extensions import Self
_T = TypeVar("_T")
@@ -225,6 +225,7 @@ class HTTPHandler(Handler):
def mapLogRecord(self, record: LogRecord) -> dict[str, Any]: ...
def getConnection(self, host: str, secure: bool) -> http.client.HTTPConnection: ... # undocumented
@type_check_only
class _QueueLike(Protocol[_T]):
def get(self) -> _T: ...
def put_nowait(self, item: _T, /) -> None: ...