From 30283aa670de85132ba08715fc12a6b69ae90bb8 Mon Sep 17 00:00:00 2001 From: Mahmoud Afaneh Date: Wed, 10 May 2017 07:20:19 -0700 Subject: [PATCH] Adds Event stub to multiprocessing (#1247) * Adds Event type to multiprocessing * Add event and context stub to multiprocessing stub. Updates per recommendations. * Adding missing newline at EOF. * Stubbing just BaseContext and not any of the member functions. * Fix flake8 extra line. * Fix comment. * Add todo for BaseContext, make ctx of Any type, and remove multiprocessing.context --- stdlib/3/multiprocessing/__init__.pyi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stdlib/3/multiprocessing/__init__.pyi b/stdlib/3/multiprocessing/__init__.pyi index 8ab505ee0..64faa0fcf 100644 --- a/stdlib/3/multiprocessing/__init__.pyi +++ b/stdlib/3/multiprocessing/__init__.pyi @@ -14,6 +14,14 @@ class AsyncResult(): def ready(self) -> bool: ... def successful(self) -> bool: ... +class Event(object): + # TODO: change ctx to BaseContext once a stub exists for multiprocessing.context + def __init__(self, *, ctx: Any) -> None: ... + def is_set(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + def wait(self, timeout: Optional[int] = None) -> bool: ... + class Pool(): def __init__(self, processes: Optional[int] = None, initializer: Optional[Callable[..., None]] = None,