Hi I've been struggling with this for the better part of the morning and was hoping someone could point me in the right direction.
This is the code I have at the moment:
def f(tup):
return some_complex_function(*tup)
def main():
pool = Pool(processes=4)
#import and process data omitted
_args = [(x.some_func1, .05, x.some_func2) for x in list_of_some_class]
results = pool.map(f, _args)
print results
The first error I get is:
> Exception in thread Thread-2: Traceback (most recent call last):
> File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
> self.run() File "/usr/lib/python2.7/threading.py", line 504, in run
> self.__target(*self.__args, **self.__kwargs) File "/usr/lib/python2.7/multiprocessing/pool.py", line 319, in
> _handle_tasks
> put(task) PicklingError: Can't pickle <type 'instancemethod'>: attribute lookup __builtin__.instancemethod failed
Any help would be very appreciated.