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/concurrent | |
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/concurrent')
-rw-r--r-- | Lib/concurrent/futures/_base.py | 3 | ||||
-rw-r--r-- | Lib/concurrent/futures/thread.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py index fd0acec..bf546f8 100644 --- a/Lib/concurrent/futures/_base.py +++ b/Lib/concurrent/futures/_base.py @@ -7,6 +7,7 @@ import collections import logging import threading import time +import types FIRST_COMPLETED = 'FIRST_COMPLETED' FIRST_EXCEPTION = 'FIRST_EXCEPTION' @@ -544,6 +545,8 @@ class Future(object): self._condition.notify_all() self._invoke_callbacks() + __class_getitem__ = classmethod(types.GenericAlias) + class Executor(object): """This is an abstract base class for concrete asynchronous executors.""" diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py index 2aa4e17..2810b35 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -10,6 +10,7 @@ from concurrent.futures import _base import itertools import queue import threading +import types import weakref import os @@ -57,6 +58,8 @@ class _WorkItem(object): else: self.future.set_result(result) + __class_getitem__ = classmethod(types.GenericAlias) + def _worker(executor_reference, work_queue, initializer, initargs): if initializer is not None: |