mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-01 13:40:23 +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
-1
@@ -2,7 +2,7 @@ import sys
|
||||
import zlib
|
||||
from _typeshed import ReadableBuffer, SizedBuffer, StrOrBytesPath, WriteableBuffer
|
||||
from io import FileIO, TextIOWrapper
|
||||
from typing import Final, Literal, Protocol, overload
|
||||
from typing import Final, Literal, Protocol, overload, type_check_only
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
@@ -25,6 +25,7 @@ FEXTRA: Final[int] # actually Literal[4] # undocumented
|
||||
FNAME: Final[int] # actually Literal[8] # undocumented
|
||||
FCOMMENT: Final[int] # actually Literal[16] # undocumented
|
||||
|
||||
@type_check_only
|
||||
class _ReadableFileobj(Protocol):
|
||||
def read(self, n: int, /) -> bytes: ...
|
||||
def seek(self, n: int, /) -> object: ...
|
||||
@@ -33,6 +34,7 @@ class _ReadableFileobj(Protocol):
|
||||
# mode: str
|
||||
# def fileno() -> int: ...
|
||||
|
||||
@type_check_only
|
||||
class _WritableFileobj(Protocol):
|
||||
def write(self, b: bytes, /) -> object: ...
|
||||
def flush(self) -> object: ...
|
||||
|
||||
Reference in New Issue
Block a user