Windson Yang <wiwind...@gmail.com> 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 <rep...@bugs.python.org>
<https://bugs.python.org/issue34134>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to