1+ import sys
12from _typeshed import ReadableBuffer
23from collections .abc import Mapping , Sequence
34from typing import Any , Final , final
4- from typing_extensions import TypeAlias
5+ from typing_extensions import Self , TypeAlias
56
67_FilterChain : TypeAlias = Sequence [Mapping [str , Any ]]
78
@@ -36,7 +37,11 @@ PRESET_EXTREME: int # v big number
3637
3738@final
3839class LZMADecompressor :
39- def __init__ (self , format : int | None = ..., memlimit : int | None = ..., filters : _FilterChain | None = ...) -> None : ...
40+ if sys .version_info >= (3 , 12 ):
41+ def __new__ (cls , format : int | None = ..., memlimit : int | None = ..., filters : _FilterChain | None = ...) -> Self : ...
42+ else :
43+ def __init__ (self , format : int | None = ..., memlimit : int | None = ..., filters : _FilterChain | None = ...) -> None : ...
44+
4045 def decompress (self , data : ReadableBuffer , max_length : int = - 1 ) -> bytes : ...
4146 @property
4247 def check (self ) -> int : ...
@@ -49,9 +54,15 @@ class LZMADecompressor:
4954
5055@final
5156class LZMACompressor :
52- def __init__ (
53- self , format : int | None = ..., check : int = ..., preset : int | None = ..., filters : _FilterChain | None = ...
54- ) -> None : ...
57+ if sys .version_info >= (3 , 12 ):
58+ def __new__ (
59+ cls , format : int | None = ..., check : int = ..., preset : int | None = ..., filters : _FilterChain | None = ...
60+ ) -> Self : ...
61+ else :
62+ def __init__ (
63+ self , format : int | None = ..., check : int = ..., preset : int | None = ..., filters : _FilterChain | None = ...
64+ ) -> None : ...
65+
5566 def compress (self , data : ReadableBuffer , / ) -> bytes : ...
5667 def flush (self ) -> bytes : ...
5768
0 commit comments