Browse Source

Iterator

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

4
README.md

@ -215,8 +215,8 @@ from itertools import count, repeat, cycle, chain, islice
```
```python
<iter> = islice(<collection>, to_exclusive)
<iter> = islice(<collection>, from_inclusive, to_exclusive [, +step_size])
<iter> = islice(<coll>, to_exclusive) # Only returns first 'to_exclusive' elements.
<iter> = islice(<coll>, from_inclusive, …) # `to_exclusive [, +step_size]`.
```

4
index.html

@ -370,8 +370,8 @@ to_exclusive = &lt;range&gt;.stop
<pre><code class="python language-python hljs">&lt;iter&gt; = chain(&lt;coll_1&gt;, &lt;coll_2&gt; [, ...]) <span class="hljs-comment"># Empties collections in order.</span>
&lt;iter&gt; = chain.from_iterable(&lt;collection&gt;) <span class="hljs-comment"># Empties collections inside a collection in order.</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;iter&gt; = islice(&lt;collection&gt;, to_exclusive)
&lt;iter&gt; = islice(&lt;collection&gt;, from_inclusive, to_exclusive [, +step_size])
<pre><code class="python language-python hljs">&lt;iter&gt; = islice(&lt;coll&gt;, to_exclusive) <span class="hljs-comment"># Only returns first 'to_exclusive' elements.</span>
&lt;iter&gt; = islice(&lt;coll&gt;, from_inclusive, …) <span class="hljs-comment"># `to_exclusive [, +step_size]`.</span>
</code></pre>
<div><h2 id="generator"><a href="#generator" name="generator">#</a>Generator</h2><ul>
<li><strong>Any function that contains a yield statement returns a generator.</strong></li>

Loading…
Cancel
Save