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

@@ -3,7 +3,7 @@ import sys
from _compression import BaseStream
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
from typing import IO, Any, Iterable, Protocol, TextIO, TypeVar, overload
from typing_extensions import Literal, SupportsIndex
from typing_extensions import Literal, SupportsIndex, final
# The following attributes and methods are optional:
# def fileno(self) -> int: ...
@@ -118,11 +118,13 @@ class BZ2File(BaseStream, IO[bytes]):
def write(self, data: ReadableBuffer) -> int: ...
def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ...
@final
class BZ2Compressor(object):
def __init__(self, compresslevel: int = ...) -> None: ...
def compress(self, __data: bytes) -> bytes: ...
def flush(self) -> bytes: ...
@final
class BZ2Decompressor(object):
def decompress(self, data: bytes, max_length: int = ...) -> bytes: ...
@property