Fix __new__ issues in 3.14 (#14626)

This commit is contained in:
Jelle Zijlstra
2025-08-23 10:01:10 -07:00
committed by GitHub
parent 85834194c0
commit 92eab7b773
3 changed files with 16 additions and 9 deletions
+4 -4
View File
@@ -45,9 +45,9 @@ class ZstdCompressor:
CONTINUE: Final = 0
FLUSH_BLOCK: Final = 1
FLUSH_FRAME: Final = 2
def __init__(
def __new__(
self, level: int | None = None, options: Mapping[int, int] | None = None, zstd_dict: ZstdDict | None = None
) -> None: ...
) -> Self: ...
def compress(
self, /, data: ReadableBuffer, mode: _ZstdCompressorContinue | _ZstdCompressorFlushBlock | _ZstdCompressorFlushFrame = 0
) -> bytes: ...
@@ -58,7 +58,7 @@ class ZstdCompressor:
@final
class ZstdDecompressor:
def __init__(self, zstd_dict: ZstdDict | None = None, options: Mapping[int, int] | None = None) -> None: ...
def __new__(self, zstd_dict: ZstdDict | None = None, options: Mapping[int, int] | None = None) -> Self: ...
def decompress(self, /, data: ReadableBuffer, max_length: int = -1) -> bytes: ...
@property
def eof(self) -> bool: ...
@@ -69,7 +69,7 @@ class ZstdDecompressor:
@final
class ZstdDict:
def __init__(self, dict_content: bytes, /, *, is_raw: bool = False) -> None: ...
def __new__(self, dict_content: bytes, /, *, is_raw: bool = False) -> Self: ...
def __len__(self, /) -> int: ...
@property
def as_digested_dict(self) -> tuple[Self, int]: ...