Issue 5642: multiprocessing.Pool.map() docs slightly misleading (original) (raw)

I found the documentation for the multiprocessing.Pool.map() method to be a little misleading, because it claims to be equivalent to the built- in map(), but it's not quite.

When the function to be applied takes just one argument, both map()s behave the same. But built-in map() allows the function to take multiple arguments (taking them from multiple iterables) whereas multiprocessing.Pool.map() requires it to have only a single argument, and if necessary its iterable argument must be composed of tuples to be unpacked inside the function.

From http://docs.python.org/library/multiprocessing.html#multiprocessing.pool .multiprocessing.Pool.map

map(func, iterable[, chunksize]) A parallel equivalent of the map() builtin function.

From http://docs.python.org/library/functions.html#map

map(function, iterable, ...) Apply function to every item of iterable and return a list of the results. If additional iterable arguments are passed, function must take that many arguments and is applied to the items from all iterables in parallel.