mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Add full class definitions for Process, Queue, and Lock (#265)
These should be all the methods one can call on those classes
This commit is contained in:
committed by
Guido van Rossum
parent
9acc9b31ac
commit
a619491060
@@ -1,15 +1,41 @@
|
||||
# Stubs for multiprocessing
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Callable, Iterable, Mapping
|
||||
|
||||
class Lock(): ...
|
||||
class Process(): ...
|
||||
class Lock():
|
||||
def acquire(self, block: bool = ..., timeout: int = ...) -> None: ...
|
||||
def release(self) -> None: ...
|
||||
|
||||
class Process():
|
||||
# TODO: set type of group to None
|
||||
def __init__(self,
|
||||
group: Any = ...,
|
||||
target: Callable = ...,
|
||||
name: str = ...,
|
||||
args: Iterable[Any] = ...,
|
||||
kwargs: Mapping[Any, Any] = ...,
|
||||
daemon: bool = ...) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
def is_alive(self) -> bool: ...
|
||||
def join(self, timeout: float = ...) -> None: ...
|
||||
|
||||
class Queue():
|
||||
def get(block: bool = ..., timeout: float = ...) -> Any: ...
|
||||
def __init__(self, maxsize: int = ...) -> None: ...
|
||||
def get(self, block: bool = ..., timeout: float = ...) -> Any: ...
|
||||
def put(self, item: Any, block: bool = ..., timeout: float = ...) -> None: ...
|
||||
def qsize(self) -> int: ...
|
||||
def empty(self) -> bool: ...
|
||||
def full(self) -> bool: ...
|
||||
def put_nowait(self, item: Any) -> None: ...
|
||||
def get_nowait(self) -> Any: ...
|
||||
def close(self) -> None: ...
|
||||
def join_thread(self) -> None: ...
|
||||
def cancel_join_thread(self) -> None: ...
|
||||
|
||||
class Value():
|
||||
def __init__(typecode_or_type: str, *args: Any, lock: bool = ...) -> None: ...
|
||||
def __init__(self, typecode_or_type: str, *args: Any, lock: bool = ...) -> None: ...
|
||||
|
||||
# ----- multiprocessing function stubs -----
|
||||
def cpu_count() -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user