1from typing import IO, Any, Union
2
3import _io
4from _io import (
5    DEFAULT_BUFFER_SIZE as DEFAULT_BUFFER_SIZE,
6    BlockingIOError as BlockingIOError,
7    BufferedRandom as BufferedRandom,
8    BufferedReader as BufferedReader,
9    BufferedRWPair as BufferedRWPair,
10    BufferedWriter as BufferedWriter,
11    BytesIO as BytesIO,
12    FileIO as FileIO,
13    IncrementalNewlineDecoder as IncrementalNewlineDecoder,
14    StringIO as StringIO,
15    TextIOWrapper as TextIOWrapper,
16    UnsupportedOperation as UnsupportedOperation,
17    open as open,
18)
19
20def _OpenWrapper(
21    file: Union[str, unicode, int],
22    mode: unicode = ...,
23    buffering: int = ...,
24    encoding: unicode = ...,
25    errors: unicode = ...,
26    newline: unicode = ...,
27    closefd: bool = ...,
28) -> IO[Any]: ...
29
30SEEK_SET: int
31SEEK_CUR: int
32SEEK_END: int
33
34class IOBase(_io._IOBase): ...
35class RawIOBase(_io._RawIOBase, IOBase): ...
36class BufferedIOBase(_io._BufferedIOBase, IOBase): ...
37
38# Note: In the actual io.py, TextIOBase subclasses IOBase.
39# (Which we don't do here because we don't want to subclass both TextIO and BinaryIO.)
40class TextIOBase(_io._TextIOBase): ...
41