Davin Potts added the comment:

Attached are proposed patches for 2.7, 3.4, and default (3.5) branches.

In these patches, the 2 examples in the documentation that showcase the use of 
pool.apply_async have been modified to specifically highlight that a single 
invocation of apply_async will only lead to a single process doing any work 
(not all of the pool's processes).

Specifically, in the first code example:
* In the 3.x branches, the example is expanded slightly to demonstrate that 
only a single process is used by a single apply_async call and that to 
accomplish similar to the mapping examples just above it, multiple apply_async 
calls are necessary.
* Also in the 3.x branches, the code deliberately causes an exception to be 
raised which will terminate the execution of this example when anyone attempts 
to run it.  Rather than provide an example which terminates prematurely, the 
exception is now caught and a message displayed to demonstrate the exception 
did indeed occur, permitting the example to run through to a successful exit.
* In the 2.7 branch, this first example is much smaller than what is in use in 
the 3.x branches -- I've expanded it to cover the same information as is being 
shared in the 3.x branches now.

Specifically, in the second code example:
* In the 3.x branches, the only change is to the comment to the right of the 
apply_async call which emphasizes that only a single process is being used.  
Also, for clarity, the reference to the exception being raised in the last line 
was changed to highlight that it's an exception defined in the multiprocessing 
library (multiprocessing.TimeoutError).
* The 2.7 branch is the same -- there were no other differences on this example 
between branches.

These updated examples have been tested with the latest from 2.7, 3.4, and 
default/3.5 branches on OSX 10.10 and Windows 7.

----------
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file38029/issue18620_py35.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18620>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to