Add @final to many unsubclassable stdlib classes (#6299)

This commit is contained in:
Alex Waygood
2021-11-15 13:45:24 +00:00
committed by GitHub
parent 5b94c6a94d
commit 10c9d8cfce
17 changed files with 48 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
import io
from _typeshed import ReadableBuffer, Self, StrOrBytesPath
from typing import IO, Any, Mapping, Sequence, TextIO, Union, overload
from typing_extensions import Literal
from typing_extensions import Literal, final
_OpenBinaryWritingMode = Literal["w", "wb", "x", "xb", "a", "ab"]
_OpenTextWritingMode = Literal["wt", "xt", "at"]
@@ -40,6 +40,7 @@ PRESET_DEFAULT: int
PRESET_EXTREME: int
# from _lzma.c
@final
class LZMADecompressor(object):
def __init__(self, format: int | None = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> None: ...
def decompress(self, data: bytes, max_length: int = ...) -> bytes: ...
@@ -53,6 +54,7 @@ class LZMADecompressor(object):
def needs_input(self) -> bool: ...
# from _lzma.c
@final
class LZMACompressor(object):
def __init__(
self, format: int | None = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ...