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: Document Pool.(star)map return type
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: AlexWaygood, dilyan.palauzov, docs@python, mdk, miss-islington, miss-islington
Priority: normal Keywords: patch, patch

Created on 2017-10-31 20:45 by dilyan.palauzov, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30191 miss-islington, 2021-12-19 00:16
PR 30191 miss-islington, 2021-12-19 00:16
PR 30192 miss-islington, 2021-12-19 00:16
Messages (5)
msg305337 - (view) Author: Дилян Палаузов (dilyan.palauzov) Date: 2017-10-31 20:45
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.starmap says:

starmap(func, iterable[, chunksize])
Like map() except that the elements of the iterable are expected to be iterables that are unpacked as arguments.

Hence an iterable of [(1,2), (3, 4)] results in [func(1,2), func(3,4)].



If it was like map() then it would have returned an iterator.  Please clarify, that Pool.map and Pool.starmap return list.
msg305338 - (view) Author: Дилян Палаузов (dilyan.palauzov) Date: 2017-10-31 20:48
Pool.starmap is not like map from the standard library, as the hyperlinking on the word map() suggests, but like Pool.map().  The latter talks about the chunksize parameter, but the former and Pool.starmap don't.
msg305500 - (view) Author: Дилян Палаузов (dilyan.palauzov) Date: 2017-11-03 19:29
If the idea is one day to switch the return type to an iterable/generator, returning from starmap() before all parallel executions have completed, this needs to be documented and the typeshed adjusted accordingly.
msg408862 - (view) Author: Alex Waygood (AlexWaygood) * (Python triager) Date: 2021-12-18 17:25
This appears to have been fixed in PR 26560 in the main branch, but it might be nice to backport it to 3.10 and 3.9
msg408877 - (view) Author: Alex Waygood (AlexWaygood) * (Python triager) Date: 2021-12-19 00:15
PR 30191 and PR 30192 are backports
History
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 76095
2021-12-26 11:17:00AlexWaygoodsetkeywords: patch, patch
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-12-19 00:16:43miss-islingtonsetpull_requests: + pull_request28413
2021-12-19 00:16:18miss-islingtonsetkeywords: + patch
nosy: + miss-islington

pull_requests: + pull_request28412
stage: backport needed -> patch review
2021-12-19 00:16:14miss-islingtonsetkeywords: + patch
nosy: + miss-islington

pull_requests: + pull_request28411
stage: backport needed -> backport needed
2021-12-19 00:15:23AlexWaygoodsetmessages: + msg408877
2021-12-18 17:25:18AlexWaygoodsetversions: + Python 3.9, Python 3.10, - Python 3.6
nosy: + AlexWaygood, mdk

messages: + msg408862

type: enhancement -> behavior
stage: backport needed
2017-11-03 19:29:34dilyan.palauzovsetmessages: + msg305500
2017-10-31 20:48:05dilyan.palauzovsetmessages: + msg305338
2017-10-31 20:45:13dilyan.palauzovcreate