This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jose Miguel Colella
Recipients Jose Miguel Colella
Date 2016-12-29.21:57:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483048651.39.0.165070292977.issue29108@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2016-12-29 21:57:31Jose Miguel Colellasetrecipients: + Jose Miguel Colella
2016-12-29 21:57:31Jose Miguel Colellasetmessageid: <1483048651.39.0.165070292977.issue29108@psf.upfronthosting.co.za>
2016-12-29 21:57:31Jose Miguel Colellalinkissue29108 messages
2016-12-29 21:57:31Jose Miguel Colellacreate