Browse Source

Partial

pull/36/head
Jure Šorn 5 years ago
parent
commit
6ce91f4866
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -827,7 +827,7 @@ from functools import partial
>>> multiply_by_3(10)
30
```
* **Partial is useful in cases when a function needs to be passed as an argument, because it enables us to set the arguments beforehand.**
* **Partial is also useful in cases when a function needs to be passed as an argument, because it enables us to set its arguments beforehand.**
* **A few examples being `'defaultdict(<function>)'`, `'iter(<function>, to_exclusive)'` and dataclass's `'field(default_factory=<function>)'`.**
### Nonlocal

2
index.html

@ -802,7 +802,7 @@ creature = Creature(Point(<span class="hljs-number">0</span>, <span class="hljs
<span class="hljs-number">30</span>
</code></pre>
<ul>
<li><strong>Partial is useful in cases when a function needs to be passed as an argument, because it enables us to set the arguments beforehand.</strong></li>
<li><strong>Partial is also useful in cases when a function needs to be passed as an argument, because it enables us to set its arguments beforehand.</strong></li>
<li><strong>A few examples being <code class="python hljs"><span class="hljs-string">'defaultdict(&lt;function&gt;)'</span></code>, <code class="python hljs"><span class="hljs-string">'iter(&lt;function&gt;, to_exclusive)'</span></code> and dataclass's <code class="python hljs"><span class="hljs-string">'field(default_factory=&lt;function&gt;)'</span></code>.</strong></li>
</ul>
<h3 id="nonlocal">Nonlocal</h3>

Loading…
Cancel
Save