mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Remove some TODOs from IO classes (#4654)
At this point, it is too late to add methods to these semi-protocols as it would break lots of existing code. Additionally, we are moving away from these classes to finer-grained protocols anyway.
This commit is contained in:
@@ -481,7 +481,6 @@ Text = str
|
||||
TYPE_CHECKING = True
|
||||
|
||||
class IO(Iterator[AnyStr], Generic[AnyStr]):
|
||||
# TODO detach
|
||||
# TODO use abstract properties
|
||||
@property
|
||||
def mode(self) -> str: ...
|
||||
@@ -497,7 +496,6 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
|
||||
def flush(self) -> None: ...
|
||||
@abstractmethod
|
||||
def isatty(self) -> bool: ...
|
||||
# TODO what if n is None?
|
||||
@abstractmethod
|
||||
def read(self, n: int = ...) -> AnyStr: ...
|
||||
@abstractmethod
|
||||
@@ -516,7 +514,6 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
|
||||
def truncate(self, size: Optional[int] = ...) -> int: ...
|
||||
@abstractmethod
|
||||
def writable(self) -> bool: ...
|
||||
# TODO buffer objects
|
||||
@abstractmethod
|
||||
def write(self, s: AnyStr) -> int: ...
|
||||
@abstractmethod
|
||||
@@ -533,9 +530,6 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
|
||||
) -> Optional[bool]: ...
|
||||
|
||||
class BinaryIO(IO[bytes]):
|
||||
# TODO readinto
|
||||
# TODO read1?
|
||||
# TODO peek?
|
||||
@abstractmethod
|
||||
def __enter__(self) -> BinaryIO: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user