Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions stdlib/2/_io.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Optional, Iterable, Tuple, List, Union
from typing import Any, BinaryIO, Optional, Iterable, Tuple, List, Union

DEFAULT_BUFFER_SIZE = ... # type: int

Expand All @@ -9,29 +9,11 @@ class BlockingIOError(IOError):
class UnsupportedOperation(ValueError, IOError): ...


class _IOBase(object):
closed = ... # type: bool
def __enter__(self) -> "_IOBase": ...
def __exit__(self, type, value, traceback) -> bool: ...
def __iter__(self) -> "_IOBase": ...
class _IOBase(BinaryIO):
def _checkClosed(self) -> None: ...
def _checkReadable(self) -> None: ...
def _checkSeekable(self) -> None: ...
def _checkWritable(self) -> None: ...
def close(self) -> None: ...
def fileno(self) -> int: ...
def flush(self) -> None: ...
def isatty(self) -> bool: ...
def next(self) -> str: ...
def readable(self) -> bool: ...
def readline(self, limit: int = ...) -> str: ...
def readlines(self, hint: int = ...) -> List[str]: ...
def seek(self, offset: int, whence: int = ...) -> None: ...
def seekable(self) -> bool: ...
def tell(self) -> int: ...
def truncate(self, size: int = ...) -> int: ...
def writable(self) -> bool: ...
def writelines(self, lines: Iterable[str]) -> None: ...

class _BufferedIOBase(_IOBase):
def read1(self, n: int) -> str: ...
Expand Down Expand Up @@ -87,8 +69,6 @@ class _TextIOBase(_IOBase):
newlines = ... # type: Union[str, unicode]
encoding = ... # type: Optional[str]
def read(self, n: int = ...) -> str: ...
def write(self) -> None:
raise UnsupportedOperation
def detach(self) -> None:
raise UnsupportedOperation

Expand Down
5 changes: 2 additions & 3 deletions stdlib/2/io.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Only a subset of functionality is included.

from typing import List, BinaryIO, TextIO, IO, overload, Iterator, Iterable, Any, Union, Optional
import _io

DEFAULT_BUFFER_SIZE = 0

Expand All @@ -13,9 +14,7 @@ def open(file: Union[str, unicode, int],
errors: unicode = ..., newline: unicode = ...,
closefd: bool = ...) -> IO[Any]: ...

class IOBase:
# TODO
...
class IOBase(_io._IOBase): ...

class BytesIO(BinaryIO):
def __init__(self, initial_bytes: str = ...) -> None: ...
Expand Down