mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-20 07:00:29 +08:00
Add @type_check_only to stub-only private classes in stdlib (#14512)
This commit is contained in:
+4
-1
@@ -6,7 +6,7 @@ from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
|
||||
from email._policybase import _MessageT
|
||||
from types import GenericAlias, TracebackType
|
||||
from typing import IO, Any, AnyStr, Generic, Literal, Protocol, TypeVar, overload
|
||||
from typing import IO, Any, AnyStr, Generic, Literal, Protocol, TypeVar, overload, type_check_only
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
__all__ = [
|
||||
@@ -31,13 +31,16 @@ __all__ = [
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@type_check_only
|
||||
class _SupportsReadAndReadline(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ...
|
||||
|
||||
_MessageData: TypeAlias = email.message.Message | bytes | str | io.StringIO | _SupportsReadAndReadline
|
||||
|
||||
@type_check_only
|
||||
class _HasIteritems(Protocol):
|
||||
def iteritems(self) -> Iterator[tuple[str, _MessageData]]: ...
|
||||
|
||||
@type_check_only
|
||||
class _HasItems(Protocol):
|
||||
def items(self) -> Iterator[tuple[str, _MessageData]]: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user