Skip to content

Commit

Permalink
Updated stubs
Browse files Browse the repository at this point in the history
They require Python 3.9+
  • Loading branch information
paulober committed Aug 11, 2022
1 parent fe73cac commit ee2f10b
Show file tree
Hide file tree
Showing 46 changed files with 978 additions and 1,495 deletions.
21 changes: 9 additions & 12 deletions stubs/stdlib/_thread.pyi
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import sys
from collections.abc import Callable
from threading import Thread
from types import TracebackType
from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Type
from typing import Any, NoReturn, Optional

error = RuntimeError

def _count() -> int: ...

_dangling: Any

class LockType:
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
def release(self) -> None: ...
def locked(self) -> bool: ...
def __enter__(self) -> bool: ...
def __exit__(
self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]
self, type: type[BaseException]|None, value: BaseException|None, traceback: TracebackType|None
) -> None: ...

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

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

class _ExceptHookArgs(Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]):
class _ExceptHookArgs(tuple[type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]):
@property
def exc_type(self) -> Type[BaseException]: ...
def exc_type(self) -> type[BaseException]: ...
@property
def exc_value(self) -> Optional[BaseException]: ...
def exc_value(self) -> BaseException|None: ...
@property
def exc_traceback(self) -> Optional[TracebackType]: ...
def exc_traceback(self) -> TracebackType|None: ...
@property
def thread(self) -> Optional[Thread]: ...
def thread(self) -> Thread|None: ...
_excepthook: Callable[[_ExceptHookArgs], Any]
Loading

0 comments on commit ee2f10b

Please sign in to comment.