Skip to content

gzip: improve bytes handling #9037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 30, 2022
Merged
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
8 changes: 4 additions & 4 deletions stdlib/gzip.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _compression
import sys
import zlib
from _typeshed import ReadableBuffer, StrOrBytesPath
from _typeshed import ReadableBuffer, StrOrBytesPath, _BufferWithLen
from io import FileIO
from typing import Any, Protocol, TextIO, overload
from typing_extensions import Literal, TypeAlias
Expand Down Expand Up @@ -159,9 +159,9 @@ class _GzipReader(_compression.DecompressReader):
def __init__(self, fp: _ReadableFileobj) -> None: ...

if sys.version_info >= (3, 8):
def compress(data: bytes, compresslevel: int = ..., *, mtime: float | None = ...) -> bytes: ...
def compress(data: _BufferWithLen, compresslevel: int = ..., *, mtime: float | None = ...) -> bytes: ...

else:
def compress(data: bytes, compresslevel: int = ...) -> bytes: ...
def compress(data: _BufferWithLen, compresslevel: int = ...) -> bytes: ...

def decompress(data: bytes) -> bytes: ...
def decompress(data: ReadableBuffer) -> bytes: ...