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 anthony-flury
Recipients anthony-flury, docs@python, xtreak
Date 2018-10-06.09:05:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538816747.49.0.545547206417.issue34891@psf.upfronthosting.co.za>
In-reply-to
Content
An example that does work : 

    $ python3

      Python 3.6.6 (default, Sep 12 2018, 18:26:19) 
      [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
      Type "help", "copyright", "credits" or "license" for more information.

      >>> from multiprocessing import Pool
      >>> def f(x): 
      ...     return x**2
      ...
      >>> with Pool(10) as p:
      ...     print(p.map(f, range(1,10)))
      [1, 4, 9, 16, 25, 36, 49, 64, 81]

So something about having Pool as a context manager means it works - very odd then.

BTW - with the exception of the example saying 'don't do this it doesn't work', none of the examples on the page are shown on the command line interpreter; but the first example uses a Pool context manager - which works as above.
History
Date User Action Args
2018-10-06 09:05:47anthony-flurysetrecipients: + anthony-flury, docs@python, xtreak
2018-10-06 09:05:47anthony-flurysetmessageid: <1538816747.49.0.545547206417.issue34891@psf.upfronthosting.co.za>
2018-10-06 09:05:47anthony-flurylinkissue34891 messages
2018-10-06 09:05:47anthony-flurycreate