Browse Source

Iterable duck types

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

2
README.md

@ -1172,7 +1172,7 @@ Iterable Duck Types
-------------------
### Iterable
* **Only required method is iter(). It should return an iterator of its contents.**
* **Only required method is iter(). It should return an iterator of object's items.**
* **Contains() automatically works on any object that has iter() defined.**
```python
class MyIterable:

2
index.html

@ -1087,7 +1087,7 @@ con = sqlite3.connect(<span class="hljs-string">'&lt;path&gt;'</span>); <span c
<h2 id="iterableducktypes"><a href="#iterableducktypes" name="iterableducktypes">#</a>Iterable Duck Types</h2>
<h3 id="iterable">Iterable</h3>
<ul>
<li><strong>Only required method is iter(). It should return an iterator of its contents.</strong></li>
<li><strong>Only required method is iter(). It should return an iterator of object's items.</strong></li>
<li><strong>Contains() automatically works on any object that has iter() defined.</strong></li>
</ul>
<pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyIterable</span>:</span>

Loading…
Cancel
Save