Skip to content

Commit 9941616

Browse files
crusaderkysrittau
authored andcommitted
Add mp_context parameter to concurrent.futures.ProcessPoolExecutor (#3078)
Closes #3076
1 parent 2b6a99c commit 9941616

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

stdlib/3/concurrent/futures/_base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, NamedTuple
1+
from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set
22
from types import TracebackType
33
import sys
44

stdlib/3/concurrent/futures/process.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Any, Callable, Optional, Tuple
2-
from ._base import Future, Executor
2+
from ._base import Executor
33
import sys
44

55
EXTRA_QUEUED_CALLS: Any
@@ -8,8 +8,11 @@ if sys.version_info >= (3,):
88
class BrokenProcessPool(RuntimeError): ...
99

1010
if sys.version_info >= (3, 7):
11+
from multiprocessing.context import BaseContext
12+
1113
class ProcessPoolExecutor(Executor):
1214
def __init__(self, max_workers: Optional[int] = ...,
15+
mp_context: Optional[BaseContext] = ...,
1316
initializer: Optional[Callable[..., None]] = ...,
1417
initargs: Tuple[Any, ...] = ...) -> None: ...
1518
else:

stdlib/3/concurrent/futures/thread.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Any, Callable, Optional, Tuple
2-
from ._base import Executor, Future
2+
from ._base import Executor
33
import sys
44

55
class ThreadPoolExecutor(Executor):

third_party/2/concurrent/futures/_base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, NamedTuple
1+
from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set
22
from types import TracebackType
33
import sys
44

third_party/2/concurrent/futures/process.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Any, Callable, Optional, Tuple
2-
from ._base import Future, Executor
2+
from ._base import Executor
33
import sys
44

55
EXTRA_QUEUED_CALLS: Any
@@ -8,8 +8,11 @@ if sys.version_info >= (3,):
88
class BrokenProcessPool(RuntimeError): ...
99

1010
if sys.version_info >= (3, 7):
11+
from multiprocessing.context import BaseContext
12+
1113
class ProcessPoolExecutor(Executor):
1214
def __init__(self, max_workers: Optional[int] = ...,
15+
mp_context: Optional[BaseContext] = ...,
1316
initializer: Optional[Callable[..., None]] = ...,
1417
initargs: Tuple[Any, ...] = ...) -> None: ...
1518
else:

third_party/2/concurrent/futures/thread.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Any, Callable, Optional, Tuple
2-
from ._base import Executor, Future
2+
from ._base import Executor
33
import sys
44

55
class ThreadPoolExecutor(Executor):

0 commit comments

Comments
 (0)