Skip to content

Commit d998d37

Browse files
authored
multiprocessing: revert changes to queue classes (#4314)
Partial revert of #4289. Fixes #4313
1 parent 5e76f51 commit d998d37

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/3/multiprocessing/__init__.pyi

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from ctypes import _CData
33
from logging import Logger
4-
from multiprocessing import connection, pool, queues, sharedctypes, spawn, synchronize
4+
from multiprocessing import connection, pool, sharedctypes, spawn, synchronize
55
from multiprocessing.context import (
66
AuthenticationError as AuthenticationError,
77
BaseContext,
@@ -14,6 +14,9 @@ from multiprocessing.context import (
1414
)
1515
from multiprocessing.managers import SyncManager
1616
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
1720
from multiprocessing.spawn import freeze_support as freeze_support
1821
from typing import Any, Callable, Iterable, List, Optional, Sequence, Tuple, Type, Union, overload
1922
from typing_extensions import Literal
@@ -35,10 +38,8 @@ def Barrier(parties: int, action: Optional[Callable[..., Any]] = ..., timeout: O
3538
def BoundedSemaphore(value: int = ...) -> synchronize.BoundedSemaphore: ...
3639
def Condition(lock: Optional[_LockLike] = ...) -> synchronize.Condition: ...
3740
def Event() -> synchronize.Event: ...
38-
def JoinableQueue(maxsize: int = ...) -> queues.JoinableQueue: ...
3941
def Lock() -> synchronize.Lock: ...
4042
def RLock() -> synchronize.RLock: ...
41-
def SimpleQueue() -> queues.SimpleQueue: ...
4243
def Semaphore(value: int = ...) -> synchronize.Semaphore: ...
4344
def Pipe(duplex: bool = ...) -> Tuple[connection.Connection, connection.Connection]: ...
4445
def Pool(
@@ -47,7 +48,6 @@ def Pool(
4748
initargs: Iterable[Any] = ...,
4849
maxtasksperchild: Optional[int] = ...,
4950
) -> pool.Pool: ...
50-
def Queue(maxsize: int = ...) -> queues.Queue: ...
5151

5252
# Functions Array and Value are copied from context.pyi.
5353
# See https://github.com/python/typeshed/blob/ac234f25927634e06d9c96df98d72d54dd80dfc4/stdlib/2and3/turtle.pyi#L284-L291

0 commit comments

Comments
 (0)