mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-29 11:16:44 +08:00
Mark stub-only private symbols as @type_check_only in third-party stubs (#14545)
This commit is contained in:
@@ -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]: ...
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user