Skip to content

Commit c714456

Browse files
committed
harmonise code layout
1 parent 6635928 commit c714456

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

demos/pool-map.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ def f(x):
77
pool = Pool(8)
88

99
# calculate x**2 in parallel for x in 0..9
10-
print(pool.map(f, range(10)))
10+
result = pool.map(f, range(10))
11+
print(result)
1112

1213
# non-blocking alternative
1314
result = pool.map_async(f, range(10))
1415
while not result.ready():
1516
print("waiting...")
1617
time.sleep(1)
17-
1818
print(result.get())
1919

demos/pool.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ def f(x):
1515
while not result.ready():
1616
print("waiting...")
1717
time.sleep(1)
18-
19-
print(result.get(timeout=1))
18+
print(result.get())
2019

0 commit comments

Comments
 (0)