[docs] context argument for multiprocessing.pool.Pool
Kai Waßmuß
kai.wassmuss at gmx.de
Fri Feb 22 10:40:18 EST 2019
Hi,
the problem was that I followed the examples in the docs and used
>>>> from multiprocessing import Pool
instead of
>>>> from multiprocessing.pool import Pool
without realizing that those two are different.
This:
"context can be used to specify the context used for starting the worker
processes. Usually a pool is created using the function
multiprocessing.Pool() or the Pool() method of a context object. In both
cases context is set appropriately."
could have given me a hint that I missed something but I tried to submit
a context argument to the function multiprocessing.Pool directly and
this function doesn't accept a context argument.
Regards,
Kai
On 22.02.19 15:22, Julien Palard wrote:
> Hi and thanks for reporting!
>
>> In the actual implementation however there is no argument context.
>
> I can't "reproduce" this statement:
>
>>>> from inspect import signature
>>>> from multiprocessing.pool import Pool
>>>> signature(Pool.__init__)
> <Signature (self, processes=None, initializer=None, initargs=(), maxtasksperchild=None, context=None)>
>
> I see a *context* here, can you be more explicit on how you though it was not here? Bests,
>
> --
> Julien Palard
> https://mdk.fr
>
>
More information about the docs
mailing list