Add missing stubs for bz2

This commit is contained in:
Thomas Aynaud
2016-12-12 14:29:18 +01:00
committed by Łukasz Langa
parent 7e6000949e
commit 0d7a5374c5

View File

@@ -1,6 +1,34 @@
# Stubs for bz2
# TODO: This stub is incomplete
from typing import Any, BinaryIO, TextIO, IO, Union
def compress(data: bytes, compresslevel: int = ...) -> bytes: ...
def decompress(data: bytes) -> bytes: ...
def open(filename: Union[str, bytes, IO[Any]],
mode: str = 'rb',
encoding: str = None,
errors: str = None,
newline: str = None) -> Union[TextIO, BinaryIO]: ...
class BZ2File(BinaryIO):
def __init__(self,
filename: Union[str, bytes, IO[Any]],
mode: str = "r",
buffering: Any = None,
compresslevel: int = 9) -> None: ...
class BZ2Compressor(object):
def __init__(self, compresslevel: int = 9) -> None: ...
def compress(self, data: bytes) -> bytes: ...
def flush(self) -> bytes: ...
class BZ2Decompressor(object):
def decompress(self, data: bytes) -> bytes: ...
@property
def eof(self) -> bool: ...
@property
def needs_input(self) -> bool: ...
@property
def unused_data(self) -> bytes: ...