Browse Source

Duck types

pull/46/head
Jure Šorn 4 years ago
parent
commit
f96dc9d265
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -1127,7 +1127,7 @@ class MySortable:
```
### Iterator
* **Any object that defines methods next() and iter() is an iterator.**
* **Any object that has methods next() and iter() is an iterator.**
* **Next() should return next item or raise StopIteration.**
* **Iter() should return 'self'.**
```python

2
index.html

@ -1072,7 +1072,7 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
<div><h3 id="iterator-1">Iterator</h3><ul>
<li><strong>Any object that defines methods next() and iter() is an iterator.</strong></li>
<li><strong>Any object that has methods next() and iter() is an iterator.</strong></li>
<li><strong>Next() should return next item or raise StopIteration.</strong></li>
<li><strong>Iter() should return 'self'.</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>

Loading…
Cancel
Save