|
1 | 1 | import io |
2 | 2 | import sys |
3 | | -from _typeshed import AnyPath |
4 | | -from typing import IO, Any, Optional, TextIO, TypeVar, Union, overload |
5 | | -from typing_extensions import Literal |
| 3 | +from _typeshed import AnyPath, ReadableBuffer, WriteableBuffer |
| 4 | +from typing import IO, Any, Iterable, List, Optional, TextIO, TypeVar, Union, overload |
| 5 | +from typing_extensions import Literal, SupportsIndex |
6 | 6 |
|
7 | 7 | _PathOrFile = Union[AnyPath, IO[bytes]] |
8 | 8 | _T = TypeVar("_T") |
@@ -49,10 +49,18 @@ class BZ2File(io.BufferedIOBase, IO[bytes]): |
49 | 49 | def __init__( |
50 | 50 | self, filename: _PathOrFile, mode: str = ..., buffering: Optional[Any] = ..., compresslevel: int = ... |
51 | 51 | ) -> None: ... |
| 52 | + def read(self, size: Optional[int] = ...) -> bytes: ... |
| 53 | + def read1(self, size: int = ...) -> bytes: ... |
| 54 | + def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore |
| 55 | + def readinto(self, b: WriteableBuffer) -> int: ... |
| 56 | + def readlines(self, size: SupportsIndex = ...) -> List[bytes]: ... |
| 57 | + def seek(self, offset: int, whence: int = ...) -> int: ... |
| 58 | + def write(self, data: ReadableBuffer) -> int: ... |
| 59 | + def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ... |
52 | 60 |
|
53 | 61 | class BZ2Compressor(object): |
54 | 62 | def __init__(self, compresslevel: int = ...) -> None: ... |
55 | | - def compress(self, data: bytes) -> bytes: ... |
| 63 | + def compress(self, __data: bytes) -> bytes: ... |
56 | 64 | def flush(self) -> bytes: ... |
57 | 65 |
|
58 | 66 | class BZ2Decompressor(object): |
|
0 commit comments