Windson Yang <[email protected]> added the comment:
The code didn't work with imap because imap create a generator, so we can't
access result outside the with statement.
with Pool(os.cpu_count()) as p:
result = p.imap(clean_up, k, 50)
for r in result:
print(r)
In
https://docs.python.org/3.4/library/multiprocessing.html?highlight=process#using-a-pool-of-workers
I found the correct example. I'm not sure should me add example or warning in
imap function.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34134>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com