Skip to content

Commit fbd8f48

Browse files
author
hauntsaninja
committed
multiprocessing: revert changes to queue classes
Partial revert of #4289. Fixes #4313
1 parent f9d469a commit fbd8f48

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

stdlib/3/multiprocessing/__init__.pyi

+3-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,8 @@ 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+
# These are technically functions that return instances of these Queue classes. See #4313 for discussion
18+
from multiprocessing.queues import JoinableQueue as JoinableQueue, Queue as Queue, SimpleQueue as SimpleQueue
1719
from multiprocessing.spawn import freeze_support as freeze_support
1820
from typing import Any, Callable, Iterable, List, Optional, Sequence, Tuple, Type, Union, overload
1921
from typing_extensions import Literal
@@ -35,10 +37,8 @@ def Barrier(parties: int, action: Optional[Callable[..., Any]] = ..., timeout: O
3537
def BoundedSemaphore(value: int = ...) -> synchronize.BoundedSemaphore: ...
3638
def Condition(lock: Optional[_LockLike] = ...) -> synchronize.Condition: ...
3739
def Event() -> synchronize.Event: ...
38-
def JoinableQueue(maxsize: int = ...) -> queues.JoinableQueue: ...
3940
def Lock() -> synchronize.Lock: ...
4041
def RLock() -> synchronize.RLock: ...
41-
def SimpleQueue() -> queues.SimpleQueue: ...
4242
def Semaphore(value: int = ...) -> synchronize.Semaphore: ...
4343
def Pipe(duplex: bool = ...) -> Tuple[connection.Connection, connection.Connection]: ...
4444
def Pool(
@@ -47,7 +47,6 @@ def Pool(
4747
initargs: Iterable[Any] = ...,
4848
maxtasksperchild: Optional[int] = ...,
4949
) -> pool.Pool: ...
50-
def Queue(maxsize: int = ...) -> queues.Queue: ...
5150

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

0 commit comments

Comments
 (0)