|
|
@ -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> |
|
|
|