|
|
@ -320,8 +320,7 @@ Point(x=<span class="hljs-number">1</span>, y=<span class="hljs-number">2</span> |
|
|
|
(<span class="hljs-string">'x'</span>, <span class="hljs-string">'y'</span>) |
|
|
|
</code></pre> |
|
|
|
<h2 id="iterator"><a href="#iterator" name="iterator">#</a>Iterator</h2> |
|
|
|
<p><strong>Iterator is any object with next() special method.</strong></p> |
|
|
|
<pre><code class="python language-python hljs"><iter> = iter(<collection>) <span class="hljs-comment"># Calling `iter(<iter>)` returns the same object.</span> |
|
|
|
<pre><code class="python language-python hljs"><iter> = iter(<collection>) |
|
|
|
<iter> = iter(<function>, to_exclusive) <span class="hljs-comment"># Sequence of return values until 'to_exclusive'.</span> |
|
|
|
<el> = next(<iter> [, default]) <span class="hljs-comment"># Raises StopIteration or returns 'default' on end.</span> |
|
|
|
</code></pre> |
|
|
|