mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-28 05:42:10 +08:00
Add @final to many unsubclassable stdlib classes (#6299)
This commit is contained in:
@@ -37,7 +37,7 @@ from typing import (
|
||||
overload,
|
||||
runtime_checkable,
|
||||
)
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, final
|
||||
|
||||
from . import path as _path
|
||||
|
||||
@@ -262,6 +262,7 @@ if sys.platform != "win32":
|
||||
TMP_MAX: int # Undocumented, but used by tempfile
|
||||
|
||||
# ----- os classes (structures) -----
|
||||
@final
|
||||
class stat_result:
|
||||
# For backward compatibility, the return value of stat() is also
|
||||
# accessible as a tuple of at least 10 integers giving the most important
|
||||
@@ -314,6 +315,7 @@ class PathLike(Protocol[_AnyStr_co]):
|
||||
|
||||
_FdOrAnyPath = Union[int, StrOrBytesPath]
|
||||
|
||||
@final
|
||||
class DirEntry(Generic[AnyStr]):
|
||||
# This is what the scandir iterator yields
|
||||
# The constructor is hidden
|
||||
@@ -334,6 +336,7 @@ if sys.platform != "win32":
|
||||
_Tuple11Int = Tuple[int, int, int, int, int, int, int, int, int, int, int]
|
||||
if sys.version_info >= (3, 7):
|
||||
# f_fsid was added in https://github.com/python/cpython/pull/4571
|
||||
@final
|
||||
class statvfs_result(_Tuple10Int): # Unix only
|
||||
def __new__(cls, seq: _Tuple10Int | _Tuple11Int, dict: dict[str, int] = ...) -> statvfs_result: ...
|
||||
n_fields: int
|
||||
@@ -566,6 +569,7 @@ if sys.platform != "win32":
|
||||
def readv(__fd: int, __buffers: Sequence[bytearray]) -> int: ...
|
||||
def writev(__fd: int, __buffers: Sequence[bytes]) -> int: ...
|
||||
|
||||
@final
|
||||
class terminal_size(Tuple[int, int]):
|
||||
columns: int
|
||||
lines: int
|
||||
|
||||
Reference in New Issue
Block a user