From 5b2c8dc883512e1acd3732203e2ef2c8e4a3f0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 8 Aug 2018 18:26:01 +0300 Subject: [PATCH] concurrent.futures: Sync with Python 3.7 (#2343) --- stdlib/3/concurrent/futures/process.pyi | 12 +++++++++--- stdlib/3/concurrent/futures/thread.pyi | 9 +++++++-- third_party/2/concurrent/futures/process.pyi | 12 +++++++++--- third_party/2/concurrent/futures/thread.pyi | 9 +++++++-- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/stdlib/3/concurrent/futures/process.pyi b/stdlib/3/concurrent/futures/process.pyi index c36180ff8..3d50123c8 100644 --- a/stdlib/3/concurrent/futures/process.pyi +++ b/stdlib/3/concurrent/futures/process.pyi @@ -1,4 +1,4 @@ -from typing import Optional, Any +from typing import Any, Callable, Optional, Tuple from ._base import Future, Executor import sys @@ -7,5 +7,11 @@ EXTRA_QUEUED_CALLS = ... # type: Any if sys.version_info >= (3,): class BrokenProcessPool(RuntimeError): ... -class ProcessPoolExecutor(Executor): - def __init__(self, max_workers: Optional[int] = ...) -> None: ... +if sys.version_info >= (3, 7): + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... +else: + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/stdlib/3/concurrent/futures/thread.pyi b/stdlib/3/concurrent/futures/thread.pyi index 4f5b501b0..983594dc7 100644 --- a/stdlib/3/concurrent/futures/thread.pyi +++ b/stdlib/3/concurrent/futures/thread.pyi @@ -1,9 +1,14 @@ -from typing import Optional +from typing import Any, Callable, Optional, Tuple from ._base import Executor, Future import sys class ThreadPoolExecutor(Executor): - if sys.version_info >= (3, 6) or sys.version_info < (3,): + if sys.version_info >= (3, 7): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... + elif sys.version_info >= (3, 6) or sys.version_info < (3,): def __init__(self, max_workers: Optional[int] = ..., thread_name_prefix: str = ...) -> None: ... else: diff --git a/third_party/2/concurrent/futures/process.pyi b/third_party/2/concurrent/futures/process.pyi index c36180ff8..3d50123c8 100644 --- a/third_party/2/concurrent/futures/process.pyi +++ b/third_party/2/concurrent/futures/process.pyi @@ -1,4 +1,4 @@ -from typing import Optional, Any +from typing import Any, Callable, Optional, Tuple from ._base import Future, Executor import sys @@ -7,5 +7,11 @@ EXTRA_QUEUED_CALLS = ... # type: Any if sys.version_info >= (3,): class BrokenProcessPool(RuntimeError): ... -class ProcessPoolExecutor(Executor): - def __init__(self, max_workers: Optional[int] = ...) -> None: ... +if sys.version_info >= (3, 7): + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... +else: + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/third_party/2/concurrent/futures/thread.pyi b/third_party/2/concurrent/futures/thread.pyi index 4f5b501b0..983594dc7 100644 --- a/third_party/2/concurrent/futures/thread.pyi +++ b/third_party/2/concurrent/futures/thread.pyi @@ -1,9 +1,14 @@ -from typing import Optional +from typing import Any, Callable, Optional, Tuple from ._base import Executor, Future import sys class ThreadPoolExecutor(Executor): - if sys.version_info >= (3, 6) or sys.version_info < (3,): + if sys.version_info >= (3, 7): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... + elif sys.version_info >= (3, 6) or sys.version_info < (3,): def __init__(self, max_workers: Optional[int] = ..., thread_name_prefix: str = ...) -> None: ... else: