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:
Martijn Pieters
2019-11-20 10:40:12 +00:00
committed by Jukka Lehtosalo
parent e065803980
commit c53bc5a7ab

View File

@@ -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]