Add in multiprocessing.managers.ValueProxy types (#3100)

Fixes #1778
This commit is contained in:
ikelos
2019-07-03 07:49:16 +01:00
committed by Sebastian Rittau
parent 75d9228b02
commit 3e700224ba

View File

@@ -5,7 +5,7 @@
import queue
import threading
from typing import (
Any, Callable, ContextManager, Dict, Iterable, List, Mapping, Optional,
Any, Callable, ContextManager, Dict, Iterable, Generic, List, Mapping, Optional,
Sequence, Tuple, TypeVar, Union,
)
@@ -17,6 +17,13 @@ class Namespace: ...
_Namespace = Namespace
class BaseProxy: ...
class ValueProxy(BaseProxy, Generic[_T]):
def get(self) -> _T: ...
def set(self, value: _T) -> None: ...
value: _T
class BaseManager(ContextManager[BaseManager]):
address: Union[str, Tuple[str, int]]
def connect(self) -> None: ...
@@ -40,7 +47,7 @@ class SyncManager(BaseManager):
def RLock(self) -> threading.RLock: ...
def Semaphore(self, value: Any = ...) -> threading.Semaphore: ...
def Array(self, typecode: Any, sequence: Sequence[_T]) -> Sequence[_T]: ...
def Value(self, typecode: Any, value: _T) -> _T: ...
def Value(self, typecode: Any, value: _T) -> ValueProxy[_T]: ...
def dict(self, sequence: Mapping[_KT, _VT] = ...) -> Dict[_KT, _VT]: ...
def list(self, sequence: Sequence[_T] = ...) -> List[_T]: ...