@@ -3,7 +3,7 @@ from typing import Any, Callable, Iterable, Optional, List, Union, Sequence, Tup
3
3
from typing_extensions import Literal
4
4
from ctypes import _CData
5
5
from logging import Logger
6
- from multiprocessing import connection , pool , spawn , synchronize
6
+ from multiprocessing import connection , pool , sharedctypes , spawn , synchronize
7
7
from multiprocessing .context import (
8
8
AuthenticationError as AuthenticationError ,
9
9
BaseContext ,
@@ -26,7 +26,6 @@ if sys.version_info >= (3, 8):
26
26
if sys .platform != "win32" :
27
27
from multiprocessing .context import ForkContext , ForkServerContext
28
28
29
-
30
29
# N.B. The functions below are generated at runtime by partially applying
31
30
# multiprocessing.context.BaseContext's methods, so the two signatures should
32
31
# be identical (modulo self).
@@ -50,30 +49,21 @@ def Pool(processes: Optional[int] = ...,
50
49
initargs : Iterable [Any ] = ...,
51
50
maxtasksperchild : Optional [int ] = ...) -> pool .Pool : ...
52
51
53
- class Array :
54
- value : Any = ...
55
-
56
- def __init__ (self , typecode_or_type : Union [str , Type [_CData ]], size_or_initializer : Union [int , Sequence [Any ]], * , lock : Union [bool , _LockLike ] = ...) -> None : ...
57
- def acquire (self ) -> bool : ...
58
- def release (self ) -> bool : ...
59
- def get_lock (self ) -> _LockLike : ...
60
- def get_obj (self ) -> Any : ...
61
-
62
- @overload
63
- def __getitem__ (self , key : int ) -> Any : ...
64
- @overload
65
- def __getitem__ (self , key : slice ) -> List [Any ]: ...
66
- def __getslice__ (self , start : int , stop : int ) -> Any : ...
67
- def __setitem__ (self , key : int , value : Any ) -> None : ...
68
-
52
+ # Functions Array and Value are copied from context.pyi.
53
+ # See https://github.com/python/typeshed/blob/ac234f25927634e06d9c96df98d72d54dd80dfc4/stdlib/2and3/turtle.pyi#L284-L291
54
+ # for rationale
55
+ def Array (
56
+ typecode_or_type : Any ,
57
+ size_or_initializer : Union [int , Sequence [Any ]],
58
+ * ,
59
+ lock : bool = ...
60
+ ) -> sharedctypes ._Array : ...
69
61
70
- class Value ():
71
- value : Any = ...
72
- def __init__ (self , typecode_or_type : Union [str , Type [_CData ]], * args : Any , lock : Union [bool , _LockLike ] = ...) -> None : ...
73
- def get_lock (self ) -> _LockLike : ...
74
- def get_obj (self ) -> Any : ...
75
- def acquire (self ) -> bool : ...
76
- def release (self ) -> bool : ...
62
+ def Value (
63
+ typecode_or_type : Any ,
64
+ * args : Any ,
65
+ lock : bool = ...
66
+ ) -> sharedctypes ._Value : ...
77
67
78
68
# ----- multiprocessing function stubs -----
79
69
def allow_connection_pickling () -> None : ...
0 commit comments