diff --git a/stdlib/2/dummy_thread.pyi b/stdlib/2/dummy_thread.pyi new file mode 100644 index 000000000..df1b21a4a --- /dev/null +++ b/stdlib/2/dummy_thread.pyi @@ -0,0 +1,22 @@ +from mypy_extensions import NoReturn +from typing import Any, Callable, Dict, Optional, Tuple + +class error(Exception): + def __init__(self, *args: Any) -> None: ... + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ... +def exit() -> NoReturn: ... +def get_ident() -> int: ... +def allocate_lock() -> LockType: ... +def stack_size(size: Optional[int] = ...) -> int: ... + +class LockType(object): + locked_status: bool + def __init__(self) -> None: ... + def acquire(self, waitflag: Optional[bool] = ...) -> bool: ... + def __enter__(self, waitflag: Optional[bool] = ...) -> bool: ... + def __exit__(self, typ: Any, val: Any, tb: Any) -> None: ... + def release(self) -> bool: ... + def locked(self) -> bool: ... + +def interrupt_main() -> None: ... diff --git a/stdlib/3/_dummy_thread.pyi b/stdlib/3/_dummy_thread.pyi index a4ff81c35..d88d2488a 100644 --- a/stdlib/3/_dummy_thread.pyi +++ b/stdlib/3/_dummy_thread.pyi @@ -1,11 +1,22 @@ -# Stubs for _dummy_thread +from mypy_extensions import NoReturn +from typing import Any, Callable, Dict, Optional, Tuple -# NOTE: These are incomplete! - -from typing import Any - -class LockType: - def acquire(self) -> None: ... - def release(self) -> None: ... +TIMEOUT_MAX: int +error = RuntimeError +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ... +def exit() -> NoReturn: ... +def get_ident() -> int: ... def allocate_lock() -> LockType: ... +def stack_size(size: Optional[int] = ...) -> int: ... + +class LockType(object): + locked_status: bool + def __init__(self) -> None: ... + def acquire(self, waitflag: Optional[bool] = ..., timeout: int = ...) -> bool: ... + def __enter__(self, waitflag: Optional[bool] = ..., timeout: int = ...) -> bool: ... + def __exit__(self, typ: Any, val: Any, tb: Any) -> None: ... + def release(self) -> bool: ... + def locked(self) -> bool: ... + +def interrupt_main() -> None: ...