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.

classification
Title: concurrent.futures.Executor.map is not equivalent to map.
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Clarify map API in concurrent.futures
View: 32306
Assigned To: Nosy List: bquinlan, majkrzak
Priority: normal Keywords:

Created on 2015-01-21 12:42 by majkrzak, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (1)
msg234433 - (view) Author: Piotr Majkrzak (majkrzak) Date: 2015-01-21 12:42
In documentation https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Executor.map is writen that this fucntion is equivalent to the builtin map. But it is not true due to the fact that it is not lazy evalueded. The reason is in https://hg.python.org/cpython/file/0893b9ee44ea/Lib/concurrent/futures/_base.py#l548 where the full list of features is created.

I don't find any reasonable solutions, but in my case following code was suitable.
https://gist.github.com/06bbd83eccd4083c68d0
History
Date User Action Args
2022-04-11 14:58:12adminsetgithub: 67478
2022-01-24 17:13:18iritkatrielsetstatus: open -> closed
superseder: Clarify map API in concurrent.futures
resolution: duplicate
stage: resolved
2015-03-19 03:03:56ned.deilysetnosy: + bquinlan

versions: - Python 3.2, Python 3.3, Python 3.4, Python 3.6
2015-01-21 12:43:00majkrzakcreate