Skip to content

Commit e8595f3

Browse files
authored
gzip: improve bytes handling (#9037)
1 parent b24a22c commit e8595f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/gzip.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import _compression
22
import sys
33
import zlib
4-
from _typeshed import ReadableBuffer, StrOrBytesPath
4+
from _typeshed import ReadableBuffer, StrOrBytesPath, _BufferWithLen
55
from io import FileIO
66
from typing import Any, Protocol, TextIO, overload
77
from typing_extensions import Literal, TypeAlias
@@ -159,9 +159,9 @@ class _GzipReader(_compression.DecompressReader):
159159
def __init__(self, fp: _ReadableFileobj) -> None: ...
160160

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

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

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

0 commit comments

Comments
 (0)