mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-30 03:42:51 +08:00
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:
+3
-2
@@ -25,7 +25,7 @@ from types import (
|
||||
TracebackType,
|
||||
WrapperDescriptorType,
|
||||
)
|
||||
from typing import Any, ClassVar, Final, Literal, NamedTuple, Protocol, TypeVar, overload
|
||||
from typing import Any, ClassVar, Final, Literal, NamedTuple, Protocol, TypeVar, overload, type_check_only
|
||||
from typing_extensions import ParamSpec, Self, TypeAlias, TypeGuard, TypeIs
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
@@ -240,10 +240,11 @@ def isasyncgenfunction(obj: Callable[..., AsyncGenerator[Any, Any]]) -> bool: ..
|
||||
def isasyncgenfunction(obj: Callable[_P, Any]) -> TypeGuard[Callable[_P, AsyncGeneratorType[Any, Any]]]: ...
|
||||
@overload
|
||||
def isasyncgenfunction(obj: object) -> TypeGuard[Callable[..., AsyncGeneratorType[Any, Any]]]: ...
|
||||
|
||||
@type_check_only
|
||||
class _SupportsSet(Protocol[_T_contra, _V_contra]):
|
||||
def __set__(self, instance: _T_contra, value: _V_contra, /) -> None: ...
|
||||
|
||||
@type_check_only
|
||||
class _SupportsDelete(Protocol[_T_contra]):
|
||||
def __delete__(self, instance: _T_contra, /) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user