File: _dummy_thread.pyi

package info (click to toggle)
typeshed 0.0~git20241223.ea91db2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,824 kB
  • sloc: python: 7,745; makefile: 21; sh: 18
file content (33 lines) | stat: -rw-r--r-- 1,252 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from collections.abc import Callable
from types import TracebackType
from typing import Any, NoReturn, overload
from typing_extensions import TypeVarTuple, Unpack

__all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "interrupt_main", "LockType", "RLock"]

_Ts = TypeVarTuple("_Ts")

TIMEOUT_MAX: int
error = RuntimeError

@overload
def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]]) -> None: ...
@overload
def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any]) -> None: ...
def exit() -> NoReturn: ...
def get_ident() -> int: ...
def allocate_lock() -> LockType: ...
def stack_size(size: int | None = None) -> int: ...

class LockType:
    locked_status: bool
    def acquire(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ...
    def __enter__(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ...
    def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ...
    def release(self) -> bool: ...
    def locked(self) -> bool: ...

class RLock(LockType):
    def release(self) -> None: ...  # type: ignore[override]

def interrupt_main() -> None: ...