Mark stub-only private symbols as @type_check_only in third-party stubs (#14545)

This commit is contained in:
Brian Schubert
2025-08-08 11:29:48 +02:00
committed by GitHub
parent a358dc24e8
commit 81c8fcb2e6
131 changed files with 334 additions and 147 deletions
+2 -1
View File
@@ -7,7 +7,7 @@ from _typeshed import SupportsWrite
from contextlib import _GeneratorContextManager
from threading import Thread
from types import TracebackType
from typing import Any, Final, Literal, Protocol, TextIO, TypeVar, overload
from typing import Any, Final, Literal, Protocol, TextIO, TypeVar, overload, type_check_only
from typing_extensions import Self, TypeAlias
STDOUT: Final = 2
@@ -18,6 +18,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True)
_StreamOutT = TypeVar("_StreamOutT", bound=_Stream[str] | _Stream[bytes])
_StreamErrT = TypeVar("_StreamErrT", bound=_Stream[str] | _Stream[bytes])
@type_check_only
class _Stream(SupportsWrite[_T_contra], Protocol):
def seek(self, offset: int, whence: int = ..., /) -> int: ...