Add a fallback overload for bz2.open as exists in gzip.open and lzma.open (#6722)

This commit is contained in:
Ruben Vorderman
2021-12-28 18:35:34 +01:00
committed by GitHub
parent 22bf9e8a78
commit 73aed3583a

View File

@@ -80,6 +80,15 @@ def open(
errors: str | None = ...,
newline: str | None = ...,
) -> TextIO: ...
@overload
def open(
filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj,
mode: str,
compresslevel: int = ...,
encoding: str | None = ...,
errors: str | None = ...,
newline: str | None = ...,
) -> BZ2File | TextIO: ...
class BZ2File(BaseStream, IO[bytes]):
def __enter__(self: Self) -> Self: ...