mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-07 10:20:58 +08:00
Add @final to many unsubclassable stdlib classes (#6299)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user