This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年04月06日 01:16 by bquinlan, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (7) | |||
|---|---|---|---|
| msg133104 - (view) | Author: Brian Quinlan (bquinlan) * (Python committer) | Date: 2011年04月06日 01:16 | |
from concurrent import futures with futures.ThreadPoolExecutor(max_workers=5) as e: e.map(print, range(10)) # No output |
|||
| msg133107 - (view) | Author: ysj.ray (ysj.ray) | Date: 2011年04月06日 05:17 | |
Isn't this the supposed behavior? |
|||
| msg133108 - (view) | Author: Brian Quinlan (bquinlan) * (Python committer) | Date: 2011年04月06日 06:12 | |
I think that it surprising behavior, especially considering that asking for the *first* element in the iterator causes *all* of the futures to be created. |
|||
| msg133196 - (view) | Author: ysj.ray (ysj.ray) | Date: 2011年04月07日 07:38 | |
Got it. Seems the behavior is not consist with the Executor.map() function: "The returned iterator raises a TimeoutError if __next__() is called and the result isn't available after timeout seconds from ***the original call to map()***" |
|||
| msg133197 - (view) | Author: Brian Quinlan (bquinlan) * (Python committer) | Date: 2011年04月07日 08:13 | |
Nice catch. I hadn't noticed that the docs are lying :-) |
|||
| msg133270 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年04月07日 22:30 | |
New changeset 126353bc7e94 by Brian Quinlan in branch 'default': Issue #11777: Executor.map does not submit futures until iter.next() is called http://hg.python.org/cpython/rev/126353bc7e94 |
|||
| msg134223 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年04月21日 15:28 | |
Just a bystander remark: when you use present in the commit message and Misc/NEWS entry (like in "Executor.map does not submit futures until iter.next() is called"), I don’t know whether it is the behavior being fixed ("X used to do Y") or the new, correct behavior ("X now does Z"). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:15 | admin | set | github: 55986 |
| 2011年04月21日 15:28:48 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg134223 |
| 2011年04月07日 22:33:02 | bquinlan | set | status: open -> closed resolution: fixed |
| 2011年04月07日 22:30:59 | python-dev | set | nosy:
+ python-dev messages: + msg133270 |
| 2011年04月07日 08:13:21 | bquinlan | set | messages: + msg133197 |
| 2011年04月07日 07:38:05 | ysj.ray | set | messages: + msg133196 |
| 2011年04月06日 06:12:37 | bquinlan | set | messages: + msg133108 |
| 2011年04月06日 05:17:14 | ysj.ray | set | nosy:
+ ysj.ray messages: + msg133107 |
| 2011年04月06日 01:16:35 | bquinlan | create | |