diff --git a/stdlib/2/multiprocessing/__init__.pyi b/stdlib/2/multiprocessing/__init__.pyi index 556d8cf75..74b5018a8 100644 --- a/stdlib/2/multiprocessing/__init__.pyi +++ b/stdlib/2/multiprocessing/__init__.pyi @@ -1,11 +1,29 @@ +from typing import Optional, TypeVar + from multiprocessing.process import Process as Process, current_process as current_process, active_children as active_children from multiprocessing.util import SUBDEBUG as SUBDEBUG, SUBWARNING as SUBWARNING +from Queue import Queue as _BaseQueue class ProcessError(Exception): ... class BufferTooShort(ProcessError): ... class TimeoutError(ProcessError): ... class AuthenticationError(ProcessError): ... +_T = TypeVar('_T') + +class Queue(_BaseQueue[_T]): + def __init__(self, maxsize: int = ...) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put_nowait(self, item: _T) -> None: ... + def get_nowait(self) -> _T: ... + def close(self) -> None: ... + def join_thread(self) -> None: ... + def cancel_join_thread(self) -> None: ... + def Manager(): ... def Pipe(duplex=True): ... def cpu_count() -> int: ... @@ -19,7 +37,6 @@ def Condition(lock=None): ... def Semaphore(value=1): ... def BoundedSemaphore(value=1): ... def Event(): ... -def Queue(maxsize=0): ... def JoinableQueue(maxsize=0): ... def Pool(processes=None, initializer=None, initargs=..., maxtasksperchild=None): ... def RawValue(typecode_or_type, *args): ...