[zstd] Improve typing for zstd_dict parameter (#15113)

This commit is contained in:
Rogdham
2025-12-08 15:02:30 +01:00
committed by GitHub
parent 5d41fd6800
commit 3e74d5c181
4 changed files with 25 additions and 15 deletions
+7 -2
View File
@@ -46,7 +46,10 @@ class ZstdCompressor:
FLUSH_BLOCK: Final = 1
FLUSH_FRAME: Final = 2
def __new__(
cls, level: int | None = None, options: Mapping[int, int] | None = None, zstd_dict: ZstdDict | None = None
cls,
level: int | None = None,
options: Mapping[int, int] | None = None,
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
) -> Self: ...
def compress(
self, /, data: ReadableBuffer, mode: _ZstdCompressorContinue | _ZstdCompressorFlushBlock | _ZstdCompressorFlushFrame = 0
@@ -58,7 +61,9 @@ class ZstdCompressor:
@final
class ZstdDecompressor:
def __new__(cls, zstd_dict: ZstdDict | None = None, options: Mapping[int, int] | None = None) -> Self: ...
def __new__(
cls, zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None, options: Mapping[int, int] | None = None
) -> Self: ...
def decompress(self, /, data: ReadableBuffer, max_length: int = -1) -> bytes: ...
@property
def eof(self) -> bool: ...