Skip to content

Update ProcessPoolExecutor for 3.14 #13994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions stdlib/@tests/stubtest_allowlists/py314.txt
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,10 @@ compression.lzma
compression.zlib
compression.zstd
concurrent.futures.__all__
concurrent.futures.Executor.map
concurrent.futures.InterpreterPoolExecutor
concurrent.futures.ProcessPoolExecutor.kill_workers
concurrent.futures.ProcessPoolExecutor.map
concurrent.futures.ProcessPoolExecutor.terminate_workers
concurrent.futures.ThreadPoolExecutor.BROKEN
concurrent.futures.ThreadPoolExecutor.prepare_context
concurrent.futures._base.Executor.map
concurrent.futures.interpreter
concurrent.futures.process.ProcessPoolExecutor.kill_workers
concurrent.futures.process.ProcessPoolExecutor.map
concurrent.futures.process.ProcessPoolExecutor.terminate_workers
concurrent.futures.thread.ThreadPoolExecutor.BROKEN
concurrent.futures.thread.ThreadPoolExecutor.prepare_context
concurrent.futures.thread.WorkerContext
Expand Down
17 changes: 14 additions & 3 deletions stdlib/concurrent/futures/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,20 @@ class Future(Generic[_T]):

class Executor:
def submit(self, fn: Callable[_P, _T], /, *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ...
def map(
self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = None, chunksize: int = 1
) -> Iterator[_T]: ...
if sys.version_info >= (3, 14):
def map(
self,
fn: Callable[..., _T],
*iterables: Iterable[Any],
timeout: float | None = None,
chunksize: int = 1,
buffersize: int | None = None,
) -> Iterator[_T]: ...
else:
def map(
self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = None, chunksize: int = 1
) -> Iterator[_T]: ...

def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
Expand Down
4 changes: 4 additions & 0 deletions stdlib/concurrent/futures/process.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,7 @@ class ProcessPoolExecutor(Executor):

def _start_executor_manager_thread(self) -> None: ...
def _adjust_process_count(self) -> None: ...

if sys.version_info >= (3, 14):
def kill_workers(self) -> None: ...
def terminate_workers(self) -> None: ...