mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix typo in multiprocessing documentation, thanks to Dmitry Tolstoy from docs@
This commit is contained in:
parent
36f021621e
commit
23089ab1db
1 changed files with 1 additions and 1 deletions
|
@ -279,7 +279,7 @@ For example::
|
|||
return x*x
|
||||
|
||||
if __name__ == '__main__':
|
||||
with Pool(processes=4) as pool # start 4 worker processes
|
||||
with Pool(processes=4) as pool: # start 4 worker processes
|
||||
result = pool.apply_async(f, [10]) # evaluate "f(10)" asynchronously
|
||||
print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
|
||||
print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue