mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Add @final to many unsubclassable stdlib classes (#6299)
This commit is contained in:
@@ -2,6 +2,7 @@ import sys
|
||||
from threading import Thread
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, NoReturn, Optional, Tuple, Type
|
||||
from typing_extensions import final
|
||||
|
||||
error = RuntimeError
|
||||
|
||||
@@ -9,6 +10,7 @@ def _count() -> int: ...
|
||||
|
||||
_dangling: Any
|
||||
|
||||
@final
|
||||
class LockType:
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
@@ -29,6 +31,7 @@ TIMEOUT_MAX: float
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def get_native_id() -> int: ... # only available on some platforms
|
||||
@final
|
||||
class _ExceptHookArgs(Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]):
|
||||
@property
|
||||
def exc_type(self) -> Type[BaseException]: ...
|
||||
|
||||
Reference in New Issue
Block a user