1
1
import sys
2
2
from ctypes import _CData
3
3
from logging import Logger
4
- from multiprocessing import connection , pool , sharedctypes , spawn , synchronize
4
+ from multiprocessing import connection , pool , sharedctypes , spawn , synchronize , queues
5
5
from multiprocessing .context import (
6
6
AuthenticationError as AuthenticationError ,
7
7
BaseContext ,
@@ -14,8 +14,7 @@ from multiprocessing.context import (
14
14
)
15
15
from multiprocessing .managers import SyncManager
16
16
from multiprocessing .process import active_children as active_children , current_process as current_process
17
- from multiprocessing .queues import JoinableQueue as JoinableQueue , Queue as Queue , SimpleQueue as SimpleQueue
18
- from multiprocessing .spawn import freeze_support as freeze_support , set_executable as set_executable
17
+ from multiprocessing .spawn import freeze_support as freeze_support
19
18
from typing import Any , Callable , Iterable , List , Optional , Sequence , Tuple , Type , Union , overload
20
19
21
20
from typing_extensions import Literal
@@ -36,9 +35,11 @@ _LockLike = Union[synchronize.Lock, synchronize.RLock]
36
35
def Barrier (parties : int , action : Optional [Callable [..., Any ]] = ..., timeout : Optional [float ] = ...) -> synchronize .Barrier : ...
37
36
def BoundedSemaphore (value : int = ...) -> synchronize .BoundedSemaphore : ...
38
37
def Condition (lock : Optional [_LockLike ] = ...) -> synchronize .Condition : ...
39
- def Event (lock : Optional [_LockLike ] = ...) -> synchronize .Event : ...
38
+ def Event () -> synchronize .Event : ...
39
+ def JoinableQueue (maxsize : int = ...) -> queues .JoinableQueue : ...
40
40
def Lock () -> synchronize .Lock : ...
41
41
def RLock () -> synchronize .RLock : ...
42
+ def SimpleQueue () -> queues .SimpleQueue : ...
42
43
def Semaphore (value : int = ...) -> synchronize .Semaphore : ...
43
44
def Pipe (duplex : bool = ...) -> Tuple [connection .Connection , connection .Connection ]: ...
44
45
def Pool (
@@ -47,6 +48,7 @@ def Pool(
47
48
initargs : Iterable [Any ] = ...,
48
49
maxtasksperchild : Optional [int ] = ...,
49
50
) -> pool .Pool : ...
51
+ def Queue (maxsize : int = ...) -> queues .Queue : ...
50
52
51
53
# Functions Array and Value are copied from context.pyi.
52
54
# See https://github.com/python/typeshed/blob/ac234f25927634e06d9c96df98d72d54dd80dfc4/stdlib/2and3/turtle.pyi#L284-L291
@@ -60,6 +62,7 @@ def cpu_count() -> int: ...
60
62
def get_logger () -> Logger : ...
61
63
def log_to_stderr (level : Optional [Union [str , int ]] = ...) -> Logger : ...
62
64
def Manager () -> SyncManager : ...
65
+ def set_executable (executable : str ) -> None : ...
63
66
def set_forkserver_preload (module_names : List [str ]) -> None : ...
64
67
def get_all_start_methods () -> List [str ]: ...
65
68
def get_start_method (allow_none : bool = ...) -> Optional [str ]: ...
0 commit comments