8000 gh-131466: `concurrent.futures.Executor.map`: avoid temporarily exceeding `buffersize` while collecting the next result by ebonnal · Pull Request #131467 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131466: concurrent.futures.Executor.map: avoid temporarily exceeding buffersize while collecting the next result #131467

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
comment on the necessity of the result container
  • Loading branch information
ebonnal committed Mar 19, 2025
commit 7a1ae463ddb50f622dfcc7f5b7c97c6881e0007f
1 change: 1 addition & 0 deletions Lib/concurrent/futures/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ def map(self, fn, *iterables, timeout=None, chunksize=1, buffersize=None):
# collected independently of the result_iterator closure.
executor_weakref = weakref.ref(self)

# used by the result_iterator to avoid keeping a reference to the result
result = collections.deque(maxlen=1)
# Yield must be hidden in closure so that the futures are submitted
# before the first iterator value is required.
Expand Down
Loading
0