Message284295
Hello I am trying to use the callback for the map_async method for Pool, but have found a bug. In the below code, only the print statement is carried out, the return is completely ignored. Is this working as designed or is this a bug?
from multiprocessing import Pool
def f(x):
return x * x
def s(x):
print(f'Here: {x}')
return type(x)
if __name__ == '__main__':
with Pool(5) as p:
result = p.map_async(f, [1, 2, 3], callback=s)
q = result.get()
print(q) |
|
Date |
User |
Action |
Args |
2016-12-29 21:57:31 | Jose Miguel Colella | set | recipients:
+ Jose Miguel Colella |
2016-12-29 21:57:31 | Jose Miguel Colella | set | messageid: <1483048651.39.0.165070292977.issue29108@psf.upfronthosting.co.za> |
2016-12-29 21:57:31 | Jose Miguel Colella | link | issue29108 messages |
2016-12-29 21:57:31 | Jose Miguel Colella | create | |
|