Browse Source

Duck types

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

2
README.md

@ -1135,7 +1135,7 @@ class Counter:
### Callable
* **All functions and classes have a call() method, hence are callable.**
* **When this cheatsheet uses `'<function>'` in an argument, it actually means `'<callable>'`.**
* **When this cheatsheet uses `'<function>'` as an argument, it actually means `'<callable>'`.**
```python
class Counter:
def __init__(self):

2
index.html

@ -1076,7 +1076,7 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
</code></pre>
<div><h3 id="callable">Callable</h3><ul>
<li><strong>All functions and classes have a call() method, hence are callable.</strong></li>
<li><strong>When this cheatsheet uses <code class="python hljs"><span class="hljs-string">'&lt;function&gt;'</span></code> in an argument, it actually means <code class="python hljs"><span class="hljs-string">'&lt;callable&gt;'</span></code>.</strong></li>
<li><strong>When this cheatsheet uses <code class="python hljs"><span class="hljs-string">'&lt;function&gt;'</span></code> as an argument, it actually means <code class="python hljs"><span class="hljs-string">'&lt;callable&gt;'</span></code>.</strong></li>
</ul><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Counter</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self)</span>:</span>
self.i = <span class="hljs-number">0</span>

Loading…
Cancel
Save