Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75102 > unrolled thread

Re: Error in example in multiprocessing

Started byTerry Reedy <tjreedy@udel.edu>
First post2014-07-23 19:07 -0400
Last post2014-07-23 19:07 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Error in example in multiprocessing Terry Reedy <tjreedy@udel.edu> - 2014-07-23 19:07 -0400

#75102 — Re: Error in example in multiprocessing

FromTerry Reedy <tjreedy@udel.edu>
Date2014-07-23 19:07 -0400
SubjectRe: Error in example in multiprocessing
Message-ID<mailman.12251.1406156885.18130.python-list@python.org>
On 7/23/2014 6:27 AM, Akshay Verma wrote:
> Example under
>
>
>       17.2.1.6. Using a pool of workers
>       <https://docs.python.org/3.4/library/multiprocessing.html#using-a-pool-of-workers>
>
> Has a error. As far as I understand, The input to res sleep function
> should be List and not integer.
>
> res  =  pool.apply_async(sleep,  10)

You are correct. Running the example results in
Traceback (most recent call last):
   File "C:\Programs\Python34\lib\multiprocessing\pool.py", line 119, in 
worker
     result = (True, func(*args, **kwds))
TypeError: sleep() argument after * must be a sequence, not int

Changing 10 to [10] and the Exception is the expected TimeoutError
I am fixing this now.

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web