make BZ2File and LZMAFile instantiable (#2115)

Part of #1476.
This commit is contained in:
Jelle Zijlstra
2018-06-11 13:59:38 -07:00
committed by Guido van Rossum
parent 764ee4eeec
commit a33a124537
2 changed files with 5 additions and 4 deletions

View File

@@ -67,7 +67,7 @@ class LZMACompressor(object):
class LZMAError(Exception): ...
class LZMAFile(BinaryIO):
class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027
def __init__(self,
filename: Optional[_PathOrFile] = ...,
mode: str = ...,
@@ -84,7 +84,7 @@ class LZMAFile(BinaryIO):
def readable(self) -> bool: ...
def writable(self) -> bool: ...
def peek(self, size: int = ...) -> bytes: ...
def read(self, size: int = ...) -> bytes: ...
def read(self, size: Optional[int] = ...) -> bytes: ...
def read1(self, size: int = ...) -> bytes: ...
def readline(self, size: int = ...) -> bytes: ...
def write(self, data: bytes) -> int: ...