Skip to content

Commit 25efe78

Browse files
committed
Threading
1 parent e26f871 commit 25efe78

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ with lock:
20402040
### Thread Pool Executor
20412041
```python
20422042
from concurrent.futures import ThreadPoolExecutor
2043-
with ThreadPoolExecutor(max_workers=None) as executor: # None == `n_cores * 5`.
2043+
with ThreadPoolExecutor(max_workers=None) as executor:
20442044
<iter> = executor.map(lambda x: x + 1, range(3)) # (1, 2, 3)
20452045
<iter> = executor.map(lambda x, y: x + y, 'abc', '123') # ('a1', 'b2', 'c3')
20462046
<Future> = executor.submit(<function> [, <arg_1>, ...])

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@
17971797
</code></pre></div>
17981798

17991799
<div><h3 id="threadpoolexecutor">Thread Pool Executor</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> concurrent.futures <span class="hljs-keyword">import</span> ThreadPoolExecutor
1800-
<span class="hljs-keyword">with</span> ThreadPoolExecutor(max_workers=<span class="hljs-keyword">None</span>) <span class="hljs-keyword">as</span> executor: <span class="hljs-comment"># None == `n_cores * 5`.</span>
1800+
<span class="hljs-keyword">with</span> ThreadPoolExecutor(max_workers=<span class="hljs-keyword">None</span>) <span class="hljs-keyword">as</span> executor:
18011801
&lt;iter&gt; = executor.map(<span class="hljs-keyword">lambda</span> x: x + <span class="hljs-number">1</span>, range(<span class="hljs-number">3</span>)) <span class="hljs-comment"># (1, 2, 3)</span>
18021802
&lt;iter&gt; = executor.map(<span class="hljs-keyword">lambda</span> x, y: x + y, <span class="hljs-string">'abc'</span>, <span class="hljs-string">'123'</span>) <span class="hljs-comment"># ('a1', 'b2', 'c3')</span>
18031803
&lt;Future&gt; = executor.submit(&lt;function&gt; [, &lt;arg_1&gt;, ...])

0 commit comments

Comments
 (0)