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
@@ -1,10 +1,11 @@
from collections.abc import Collection, Container, Generator, Iterable, Iterator, MutableSet
from itertools import islice
from typing import Any, Literal, Protocol, SupportsIndex, TypeVar, overload
from typing import Any, Literal, Protocol, SupportsIndex, TypeVar, overload, type_check_only
from typing_extensions import Self
_T_co = TypeVar("_T_co", covariant=True)
@type_check_only
class _RSub(Iterable[_T_co], Protocol):
def __new__(cls: type[_RSub[_T_co]], param: list[_T_co], /) -> _RSub[_T_co]: ...
+2 -1
View File
@@ -1,6 +1,7 @@
from typing import Any, Literal, Protocol
from typing import Any, Literal, Protocol, type_check_only
from typing_extensions import Self
@type_check_only
class _Sentinel(Protocol):
def __bool__(self) -> Literal[False]: ...
def __copy__(self) -> Self: ...