diff --git a/stdlib/bz2.pyi b/stdlib/bz2.pyi index c26698d88..bb1b4cf3c 100644 --- a/stdlib/bz2.pyi +++ b/stdlib/bz2.pyi @@ -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: ...