mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-12 03:10:52 +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:
@@ -2,7 +2,7 @@ import sys
|
||||
from _typeshed import AnyStr_co, StrOrBytesPath
|
||||
from collections.abc import Callable, Iterable
|
||||
from types import GenericAlias, TracebackType
|
||||
from typing import IO, Any, AnyStr, Generic, Literal, Protocol, overload
|
||||
from typing import IO, Any, AnyStr, Generic, Literal, Protocol, overload, type_check_only
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
__all__ = [
|
||||
@@ -25,6 +25,7 @@ if sys.version_info >= (3, 11):
|
||||
else:
|
||||
_TextMode: TypeAlias = Literal["r", "rU", "U"]
|
||||
|
||||
@type_check_only
|
||||
class _HasReadlineAndFileno(Protocol[AnyStr_co]):
|
||||
def readline(self) -> AnyStr_co: ...
|
||||
def fileno(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user