diff options
author | Batuhan Taşkaya <batuhanosmantaskaya@gmail.com> | 2020-04-10 14:46:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-10 14:46:36 (GMT) |
commit | 0361556537686f857f1025ead75e6af4ca7cc94a (patch) | |
tree | 3cce4f12e341d4266d1308f94a92a7c4b25bcdf9 /Lib/multiprocessing | |
parent | e3ec44d692d9442e640cf5b2d8708157a65cec3e (diff) | |
download | cpython-0361556537686f857f1025ead75e6af4ca7cc94a.zip cpython-0361556537686f857f1025ead75e6af4ca7cc94a.tar.gz cpython-0361556537686f857f1025ead75e6af4ca7cc94a.tar.bz2 |
bpo-39481: PEP 585 for a variety of modules (GH-19423)
- concurrent.futures
- ctypes
- http.cookies
- multiprocessing
- queue
- tempfile
- unittest.case
- urllib.parse
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/managers.py | 3 | ||||
-rw-r--r-- | Lib/multiprocessing/pool.py | 3 | ||||
-rw-r--r-- | Lib/multiprocessing/queues.py | 3 | ||||
-rw-r--r-- | Lib/multiprocessing/shared_memory.py | 3 |
4 files changed, 12 insertions, 0 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index 1668220..9d490a1 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -21,6 +21,7 @@ import signal import array import queue import time +import types import os from os import getpid @@ -1129,6 +1130,8 @@ class ValueProxy(BaseProxy): return self._callmethod('set', (value,)) value = property(get, set) + __class_getitem__ = classmethod(types.GenericAlias) + BaseListProxy = MakeProxyType('BaseListProxy', ( '__add__', '__contains__', '__delitem__', '__getitem__', '__len__', diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index 41dd923..b8a0b82 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -20,6 +20,7 @@ import queue import threading import time import traceback +import types import warnings from queue import Empty @@ -780,6 +781,8 @@ class ApplyResult(object): del self._cache[self._job] self._pool = None + __class_getitem__ = classmethod(types.GenericAlias) + AsyncResult = ApplyResult # create alias -- see #17805 # diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index d112db2..8350701 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -14,6 +14,7 @@ import os import threading import collections import time +import types import weakref import errno @@ -366,3 +367,5 @@ class SimpleQueue(object): else: with self._wlock: self._writer.send_bytes(obj) + + __class_getitem__ = classmethod(types.GenericAlias) diff --git a/Lib/multiprocessing/shared_memory.py b/Lib/multiprocessing/shared_memory.py index 184e367..9f954d9 100644 --- a/Lib/multiprocessing/shared_memory.py +++ b/Lib/multiprocessing/shared_memory.py @@ -14,6 +14,7 @@ import os import errno import struct import secrets +import types if os.name == "nt": import _winapi @@ -508,3 +509,5 @@ class ShareableList: return position else: raise ValueError(f"{value!r} not in this container") + + __class_getitem__ = classmethod(types.GenericAlias) |