Skip to content

Commit a641fb1

Browse files
committed
comment on weakref
1 parent 6525fe7 commit a641fb1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/concurrent/futures/_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,8 @@ def map(self, fn, *iterables, timeout=None, chunksize=1, buffersize=None):
614614
else:
615615
fs = [self.submit(fn, *args) for args in args_iter]
616616

617+
# use a weak reference to ensure that the executor can be garbage
618+
# collected independently of the result_iterator closure.
617619
executor_weakref = weakref.ref(self)
618620

619621
# Yield must be hidden in closure so that the futures are submitted

0 commit comments

Comments
 (0)