Skip to content

Commit ee2f10b

Browse files
committed
Updated stubs
They require Python 3.9+
1 parent fe73cac commit ee2f10b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+978
-1495
lines changed

stubs/stdlib/_thread.pyi

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
import sys
2+
from collections.abc import Callable
23
from threading import Thread
34
from types import TracebackType
4-
from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Type
5+
from typing import Any, NoReturn, Optional
56

67
error = RuntimeError
78

8-
def _count() -> int: ...
9-
10-
_dangling: Any
11-
129
class LockType:
1310
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
1411
def release(self) -> None: ...
1512
def locked(self) -> bool: ...
1613
def __enter__(self) -> bool: ...
1714
def __exit__(
18-
self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]
15+
self, type: type[BaseException]|None, value: BaseException|None, traceback: TracebackType|None
1916
) -> None: ...
2017

21-
def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> int: ...
18+
def start_new_thread(function: Callable[..., ...], args: tuple[..., ...], kwargs: dict[str, Any] = ...) -> int: ...
2219
def allocate_lock() -> LockType: ...
2320
def exit() -> NoReturn: ...
2421
def get_ident() -> int: ...
@@ -28,13 +25,13 @@ TIMEOUT_MAX: float
2825

2926
if sys.version_info >= (3, 8):
3027

31-
class _ExceptHookArgs(Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]):
28+
class _ExceptHookArgs(tuple[type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]):
3229
@property
33-
def exc_type(self) -> Type[BaseException]: ...
30+
def exc_type(self) -> type[BaseException]: ...
3431
@property
35-
def exc_value(self) -> Optional[BaseException]: ...
32+
def exc_value(self) -> BaseException|None: ...
3633
@property
37-
def exc_traceback(self) -> Optional[TracebackType]: ...
34+
def exc_traceback(self) -> TracebackType|None: ...
3835
@property
39-
def thread(self) -> Optional[Thread]: ...
36+
def thread(self) -> Thread|None: ...
4037
_excepthook: Callable[[_ExceptHookArgs], Any]

0 commit comments

Comments
 (0)