Skip to content
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions stdlib/gzip.pyi
Original file line number Diff line number Diff line change
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: ReadableBuffer, compresslevel: int = ..., *, mtime: float | None = ...) -> bytes: ...
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This also does len(data) in one branch, so we should use _BufferWithLen.

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.

Done!


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

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