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:
Sebastian Rittau
2020-11-01 22:11:19 +01:00
committed by GitHub
parent fd6bb39f55
commit 8aa3346a9c

View File

@@ -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: ...