mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 05:22:23 +08:00
Dummy thread improvements (#1309)
* dummy_thread improvements - Complete the Python 3 stub - Add a Python 2 stub. They're close enough that they should go into 2and3, but the module name changed so we can't do that. * fix my bugs
This commit is contained in:
committed by
Matthias Kramm
parent
48796411ed
commit
3267e2396b
22
stdlib/2/dummy_thread.pyi
Normal file
22
stdlib/2/dummy_thread.pyi
Normal file
@@ -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: ...
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user