Using Pool map with a method of a class and a list

Luca Cerone luca.cerone at gmail.com
Tue Aug 6 15:42:31 EDT 2013


Hi Chris, thanks

> Do you ever instantiate any A() objects? You're attempting to call an
> 
> unbound method without passing it a 'self'.

I have tried a lot of variations, instantiating the object, creating lambda functions that use the unbound version of fun (A.fun.__func__) etc etc..
I have played around it quite a bit before posting.

As far as I have understood the problem is due to the fact that Pool pickle the function and copy it in the various pools.. 
But since the methods cannot be pickled this fails..

The same example I posted won't run in Python 3.2 neither (I am mostly interested in a solution for Python 2.7, sorry I forgot to mention that).

Thanks in any case for the help, hopefully there will be some other advice in the ML :)

Cheers,
Luca



More information about the Python-list mailing list