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:
Max Payton
2016-06-04 18:31:48 -07:00
committed by Guido van Rossum
parent 9acc9b31ac
commit a619491060

View File

@@ -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: ...