Browse Source

Iterable duck types

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

2
README.md

@ -1194,7 +1194,7 @@ True
### Collection
* **Only required methods are iter() and len().**
* **This cheatsheet actually means `'<iterable>'` when it uses `'<collection>'`.**
* **I chose not to use the name iterable because it sounds scarier and more vague than collection.**
* **I chose not to use the name 'iterable' because it sounds scarier and more vague than 'collection'.**
```python
class MyCollection:
def __init__(self, a):

2
index.html

@ -1107,7 +1107,7 @@ con = sqlite3.connect(<span class="hljs-string">'&lt;path&gt;'</span>); <span c
<ul>
<li><strong>Only required methods are iter() and len().</strong></li>
<li><strong>This cheatsheet actually means <code class="python hljs"><span class="hljs-string">'&lt;iterable&gt;'</span></code> when it uses <code class="python hljs"><span class="hljs-string">'&lt;collection&gt;'</span></code>.</strong></li>
<li><strong>I chose not to use the name iterable because it sounds scarier and more vague than collection.</strong></li>
<li><strong>I chose not to use the name 'iterable' because it sounds scarier and more vague than 'collection'.</strong></li>
</ul>
<pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyCollection</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, a)</span>:</span>

Loading…
Cancel
Save