mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Add missing elements for multiprocessing.dummy (#3471)
`multiprocessing.dummy` exports names that were not yet listed in the typeshed stub:
```python
>>> from multiprocessing import dummy as mpdummy
>>> imported_objects = (
... (name, obj) for name, obj in vars(mpdummy).items()
... if name in mpdummy.__all__ and not obj.__module__.startswith("multiprocessing.dummy")
... )
>>> print(*(f"{name}: {obj.__module__}" for name, obj in sorted(imported_objects)), sep="\n")
Barrier: threading
BoundedSemaphore: threading
Condition: threading
Event: threading
JoinableQueue: queue
Lock: _thread
Queue: queue
RLock: threading
Semaphore: threading
current_process: threading
```
Of these, only `JoinableQueue` was listed.
This commit is contained in:
committed by
Jukka Lehtosalo
parent
e065803980
commit
c53bc5a7ab
@@ -4,10 +4,16 @@ import array
|
||||
import threading
|
||||
import weakref
|
||||
|
||||
from queue import Queue
|
||||
from queue import Queue as Queue
|
||||
|
||||
JoinableQueue = Queue
|
||||
|
||||
Barrier = threading.Barrier
|
||||
BoundedSemaphore = threading.BoundedSemaphore
|
||||
Condition = threading.Condition
|
||||
Event = threading.Event
|
||||
Lock = threading.Lock
|
||||
RLock = threading.RLock
|
||||
Semaphore = threading.Semaphore
|
||||
|
||||
class DummyProcess(threading.Thread):
|
||||
_children: weakref.WeakKeyDictionary[Any, Any]
|
||||
|
||||
Reference in New Issue
Block a user