From d9c5422ebf241d5dd193dc6270fffee5a6677cea Mon Sep 17 00:00:00 2001 From: Philipp Schrader Date: Sat, 13 Apr 2019 11:35:52 -0700 Subject: [PATCH] Add stub for multiprocessing.Value.get_lock() (#2920) I also noticed that the "lock" parameter for Value's __init__ was incomplete. The parameter also accepts lock objects directly. https://docs.python.org/3.7/library/multiprocessing.html#multiprocessing.Value Fixes #2917 --- stdlib/3/multiprocessing/__init__.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/3/multiprocessing/__init__.pyi b/stdlib/3/multiprocessing/__init__.pyi index 3356bb50a..e5fad0a5a 100644 --- a/stdlib/3/multiprocessing/__init__.pyi +++ b/stdlib/3/multiprocessing/__init__.pyi @@ -68,7 +68,8 @@ class Process(): class Value(): value: Any = ... - def __init__(self, typecode_or_type: str, *args: Any, lock: bool = ...) -> None: ... + def __init__(self, typecode_or_type: str, *args: Any, lock: Union[bool, _LockLike] = ...) -> None: ... + def get_lock(self) -> _LockLike: ... # ----- multiprocessing function stubs ----- def active_children() -> List[Process]: ...