Skip to content

Commit dba864a

Browse files
committed
Duck types
1 parent 6194905 commit dba864a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ class MySortable:
11561156
* **Any object that has methods next() and iter() is an iterator.**
11571157
* **Next() should return next item or raise StopIteration exception.**
11581158
* **Iter() should return an iterator of remaining items, i.e. 'self'.**
1159-
* **Only objects that have iter() method can be used in for loops.**
1159+
* **Any object that has iter() method can be used in a for loop.**
11601160
```python
11611161
class Counter:
11621162
def __init__(self):

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@
989989
<li><strong>Any object that has methods next() and iter() is an iterator.</strong></li>
990990
<li><strong>Next() should return next item or raise StopIteration exception.</strong></li>
991991
<li><strong>Iter() should return an iterator of remaining items, i.e. 'self'.</strong></li>
992-
<li><strong>Only objects that have iter() method can be used in for loops.</strong></li>
992+
<li><strong>Any object that has iter() method can be used in a for loop.</strong></li>
993993
</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>
994994
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self)</span>:</span>
995995
self.i = <span class="hljs-number">0</span>

0 commit comments

Comments
 (0)