Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions stdlib/2and3/bz2.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import sys
from typing import Any, BinaryIO, IO, Optional, Union
from typing import Any, IO, Optional, Union

if sys.version_info >= (3, 6):
from os import PathLike
Expand All @@ -20,7 +21,7 @@ if sys.version_info >= (3, 3):
errors: Optional[str] = ...,
newline: Optional[str] = ...) -> IO[Any]: ...

class BZ2File(BinaryIO):
class BZ2File(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At runtime it inherits from _compression.BaseStream, which is a subclass of BufferedIOBase that adds some private methods.

def __init__(self,
filename: _PathOrFile,
mode: str = ...,
Expand Down
4 changes: 2 additions & 2 deletions stdlib/3.3/lzma.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ...,
Expand All @@ -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: ...
Expand Down