From 861bf36b857a9866e45df3a4b399ee4aabe1430c Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 27 Oct 2022 06:07:37 -0700 Subject: [PATCH 1/3] lzma: Takes ReadableBuffer, not bytes --- stdlib/lzma.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/lzma.pyi b/stdlib/lzma.pyi index 868da0f05567..288cafc7aebb 100644 --- a/stdlib/lzma.pyi +++ b/stdlib/lzma.pyi @@ -83,7 +83,7 @@ PRESET_EXTREME: int # v big number @final class LZMADecompressor: def __init__(self, format: int | None = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> None: ... - def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + def decompress(self, data: ReadableBuffer, max_length: int = ...) -> bytes: ... @property def check(self) -> int: ... @property @@ -99,7 +99,7 @@ class LZMACompressor: def __init__( self, format: int | None = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... ) -> None: ... - def compress(self, __data: bytes) -> bytes: ... + def compress(self, __data: ReadableBuffer) -> bytes: ... def flush(self) -> bytes: ... class LZMAError(Exception): ... @@ -189,7 +189,7 @@ def open( newline: str | None = ..., ) -> LZMAFile | TextIO: ... def compress( - data: bytes, format: int = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... + data: _ReadableBuffer, format: int = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... ) -> bytes: ... -def decompress(data: bytes, format: int = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> bytes: ... +def decompress(data: _ReadableBuffer, format: int = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> bytes: ... def is_check_supported(__check_id: int) -> bool: ... From 83c0f6a685f3a0ec5b8b0468c164a522d4eaaf09 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 27 Oct 2022 13:10:25 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/lzma.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/lzma.pyi b/stdlib/lzma.pyi index 288cafc7aebb..655fb706e243 100644 --- a/stdlib/lzma.pyi +++ b/stdlib/lzma.pyi @@ -191,5 +191,7 @@ def open( def compress( data: _ReadableBuffer, format: int = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... ) -> bytes: ... -def decompress(data: _ReadableBuffer, format: int = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> bytes: ... +def decompress( + data: _ReadableBuffer, format: int = ..., memlimit: int | None = ..., filters: _FilterChain | None = ... +) -> bytes: ... def is_check_supported(__check_id: int) -> bool: ... From 5f5b159415abb88bf3be1cac19f5d44a7d9f6444 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 27 Oct 2022 06:53:12 -0700 Subject: [PATCH 3/3] Update stdlib/lzma.pyi --- stdlib/lzma.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/lzma.pyi b/stdlib/lzma.pyi index 655fb706e243..9d75c627f76d 100644 --- a/stdlib/lzma.pyi +++ b/stdlib/lzma.pyi @@ -189,9 +189,9 @@ def open( newline: str | None = ..., ) -> LZMAFile | TextIO: ... def compress( - data: _ReadableBuffer, format: int = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... + data: ReadableBuffer, format: int = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... ) -> bytes: ... def decompress( - data: _ReadableBuffer, format: int = ..., memlimit: int | None = ..., filters: _FilterChain | None = ... + data: ReadableBuffer, format: int = ..., memlimit: int | None = ..., filters: _FilterChain | None = ... ) -> bytes: ... def is_check_supported(__check_id: int) -> bool: ...