1
1
import sys
2
2
from ctypes import _CData
3
3
from logging import Logger
4
- from multiprocessing import connection , pool , queues , sharedctypes , spawn , synchronize
4
+ from multiprocessing import connection , pool , sharedctypes , spawn , synchronize
5
5
from multiprocessing .context import (
6
6
AuthenticationError as AuthenticationError ,
7
7
BaseContext ,
@@ -14,6 +14,9 @@ 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
+
18
+ # These are technically functions that return instances of these Queue classes. See #4313 for discussion
19
+ from multiprocessing .queues import JoinableQueue as JoinableQueue , Queue as Queue , SimpleQueue as SimpleQueue
17
20
from multiprocessing .spawn import freeze_support as freeze_support
18
21
from typing import Any , Callable , Iterable , List , Optional , Sequence , Tuple , Type , Union , overload
19
22
from typing_extensions import Literal
@@ -35,10 +38,8 @@ def Barrier(parties: int, action: Optional[Callable[..., Any]] = ..., timeout: O
35
38
def BoundedSemaphore (value : int = ...) -> synchronize .BoundedSemaphore : ...
36
39
def Condition (lock : Optional [_LockLike ] = ...) -> synchronize .Condition : ...
37
40
def Event () -> synchronize .Event : ...
38
- def JoinableQueue (maxsize : int = ...) -> queues .JoinableQueue : ...
39
41
def Lock () -> synchronize .Lock : ...
40
42
def RLock () -> synchronize .RLock : ...
41
- 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,7 +48,6 @@ def Pool(
47
48
initargs : Iterable [Any ] = ...,
48
49
maxtasksperchild : Optional [int ] = ...,
49
50
) -> pool .Pool : ...
50
- def Queue (maxsize : int = ...) -> queues .Queue : ...
51
51
52
52
# Functions Array and Value are copied from context.pyi.
53
53
# See https://github.com/python/typeshed/blob/ac234f25927634e06d9c96df98d72d54dd80dfc4/stdlib/2and3/turtle.pyi#L284-L291
0 commit comments