bz2 stub exceptions (#5199)

This commit is contained in:
hatal175
2021-04-11 05:53:05 +03:00
committed by GitHub
parent 25bac1d716
commit b308c1f964
6 changed files with 16 additions and 14 deletions

View File

@@ -1,8 +1,8 @@
import io
import sys
from _typeshed import AnyPath
from typing import IO, Any, Optional, TextIO, TypeVar, Union, overload
from typing_extensions import Literal
from _typeshed import AnyPath, ReadableBuffer, WriteableBuffer
from typing import IO, Any, Iterable, List, Optional, TextIO, TypeVar, Union, overload
from typing_extensions import Literal, SupportsIndex
_PathOrFile = Union[AnyPath, IO[bytes]]
_T = TypeVar("_T")
@@ -49,10 +49,18 @@ class BZ2File(io.BufferedIOBase, IO[bytes]):
def __init__(
self, filename: _PathOrFile, mode: str = ..., buffering: Optional[Any] = ..., compresslevel: int = ...
) -> None: ...
def read(self, size: Optional[int] = ...) -> bytes: ...
def read1(self, size: int = ...) -> bytes: ...
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore
def readinto(self, b: WriteableBuffer) -> int: ...
def readlines(self, size: SupportsIndex = ...) -> List[bytes]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def write(self, data: ReadableBuffer) -> int: ...
def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ...
class BZ2Compressor(object):
def __init__(self, compresslevel: int = ...) -> None: ...
def compress(self, data: bytes) -> bytes: ...
def compress(self, __data: bytes) -> bytes: ...
def flush(self) -> bytes: ...
class BZ2Decompressor(object):