concurrent.futures: add _work_queue property to ThreadPoolExecutor (#4808)

`ThreadPoolExecutor` assigns a `queue.SimpleQueue` to `_work_queue` in
its `__init__` method.

https://github.com/python/cpython/blob/7cf0aad96d1d20f07d7f0e374885f327c2d5ff27/Lib/concurrent/futures/thread.py#L144
This commit is contained in:
Steve Dignam
2020-12-09 22:23:19 -05:00
committed by GitHub
parent cb43535541
commit 3d14016085
+5
View File
@@ -1,3 +1,4 @@
import queue
import sys
from typing import Any, Callable, Generic, Iterable, Mapping, Optional, Tuple, TypeVar
@@ -13,6 +14,10 @@ if sys.version_info >= (3, 9):
_S = TypeVar("_S")
class ThreadPoolExecutor(Executor):
if sys.version_info >= (3, 7):
_work_queue: queue.SimpleQueue
else:
_work_queue: queue.Queue
if sys.version_info >= (3, 7):
def __init__(
self,