From 0679e0232c04b26112d36d6cc9421e8ec674e647 Mon Sep 17 00:00:00 2001 From: Luka Sterbic Date: Mon, 5 Jun 2017 23:58:52 +0200 Subject: [PATCH] Add start, shutdown and context manager methods to BaseManager (#1392) --- stdlib/3/multiprocessing/managers.pyi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stdlib/3/multiprocessing/managers.pyi b/stdlib/3/multiprocessing/managers.pyi index fb5d7e1f7..00c72aabe 100644 --- a/stdlib/3/multiprocessing/managers.pyi +++ b/stdlib/3/multiprocessing/managers.pyi @@ -4,7 +4,9 @@ import queue import threading -from typing import Any, Dict, List, Mapping, Sequence, TypeVar +from typing import ( + Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, TypeVar +) _T = TypeVar('_T') _KT = TypeVar('_KT') @@ -16,6 +18,11 @@ _Namespace = Namespace class BaseManager: def register(self, typeid: str, callable: Any = ...) -> None: ... + def shutdown(self) -> None: ... + def start(self, initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ...) -> None: ... + def __enter__(self) -> 'BaseManager': ... + def __exit__(self, exc_type, exc_value, tb) -> None: ... class SyncManager(BaseManager): def BoundedSemaphore(self, value: Any = ...) -> threading.BoundedSemaphore: ...