Skip to content

Commit f58b9cc

Browse files
committed
General fixes from List until Iterator
1 parent 0d08e12 commit f58b9cc

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ flatter_list = list(itertools.chain.from_iterable(<list>))
5353
product_of_elems = functools.reduce(lambda out, el: out * el, <collection>)
5454
list_of_chars = list(<str>)
5555
```
56-
* **Module [operator](#operator) provides functions itemgetter() and mul() that offer the same functionality as lambda expressions above.**
56+
* **Module [operator](#operator) provides functions itemgetter() and mul() that offer the same functionality as [lambda](#lambda) expressions above.**
5757

5858
```python
5959
<int> = <list>.count(<el>) # Returns number of occurrences. Also works on strings.
@@ -205,7 +205,7 @@ from itertools import count, repeat, cycle, chain, islice
205205
```
206206

207207
```python
208-
<iter> = count(start=0, step=1) # Returns incremented value endlessly.
208+
<iter> = count(start=0, step=1) # Returns updated value endlessly. Accepts floats.
209209
<iter> = repeat(<el> [, times]) # Returns element endlessly or 'times' times.
210210
<iter> = cycle(<collection>) # Repeats the sequence endlessly.
211211
```
@@ -261,8 +261,8 @@ Type
261261
from types import FunctionType, MethodType, LambdaType, GeneratorType
262262
```
263263

264-
### ABC
265-
**An abstract base class introduces virtual subclasses that don’t inherit from it, but are still recognized by isinstance() and issubclass().**
264+
### Abstract Base Classes
265+
**Each abstract base class specifies a set of virtual subclasses. This classes get recognized by isinstance() and issubclass() as subclasses of the ABC, although they are really not.**
266266

267267
```python
268268
>>> from collections.abc import Sequence, Collection, Iterable
@@ -614,7 +614,7 @@ from dateutil.tz import UTC, tzlocal, gettz, resolve_imaginary
614614
```python
615615
<tzinfo> = UTC # UTC timezone. London without DST.
616616
<tzinfo> = tzlocal() # Local timezone. Also gettz().
617-
<tzinfo> = gettz('<Cont.>/<City>') # 'Continent/City_Name' timezone or None.
617+
<tzinfo> = gettz('<Continent>/<City>') # 'Continent/City_Name' timezone or None.
618618
<DTa> = <DT>.astimezone(<tzinfo>) # Datetime, converted to passed timezone.
619619
<Ta/DTa> = <T/DT>.replace(tzinfo=<tzinfo>) # Unconverted object with new timezone.
620620
```
@@ -1106,7 +1106,7 @@ class MyHashable:
11061106
```
11071107

11081108
### Sortable
1109-
* **With total_ordering decorator you only need to provide eq() and one of lt(), gt(), le() or ge() special methods.**
1109+
* **With total_ordering decorator, you only need to provide eq() and one of lt(), gt(), le() or ge() special methods.**
11101110
```python
11111111
from functools import total_ordering
11121112

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
list_of_chars = list(&lt;str&gt;)
251251
</code></pre>
252252
<ul>
253-
<li><strong>Module <a href="#operator">operator</a> provides functions itemgetter() and mul() that offer the same functionality as lambda expressions above.</strong></li>
253+
<li><strong>Module <a href="#operator">operator</a> provides functions itemgetter() and mul() that offer the same functionality as <a href="#lambda">lambda</a> expressions above.</strong></li>
254254
</ul>
255255
<pre><code class="python language-python hljs">&lt;int&gt; = &lt;list&gt;.count(&lt;el&gt;) <span class="hljs-comment"># Returns number of occurrences. Also works on strings.</span>
256256
index = &lt;list&gt;.index(&lt;el&gt;) <span class="hljs-comment"># Returns index of first occurrence or raises ValueError.</span>
@@ -353,7 +353,7 @@
353353
<div><h3 id="itertools">Itertools</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> itertools <span class="hljs-keyword">import</span> count, repeat, cycle, chain, islice
354354
</code></pre></div>
355355

356-
<pre><code class="python language-python hljs">&lt;iter&gt; = count(start=<span class="hljs-number">0</span>, step=<span class="hljs-number">1</span>) <span class="hljs-comment"># Returns incremented value endlessly.</span>
356+
<pre><code class="python language-python hljs">&lt;iter&gt; = count(start=<span class="hljs-number">0</span>, step=<span class="hljs-number">1</span>) <span class="hljs-comment"># Returns updated value endlessly. Accepts floats.</span>
357357
&lt;iter&gt; = repeat(&lt;el&gt; [, times]) <span class="hljs-comment"># Returns element endlessly or 'times' times.</span>
358358
&lt;iter&gt; = cycle(&lt;collection&gt;) <span class="hljs-comment"># Repeats the sequence endlessly.</span>
359359
</code></pre>
@@ -392,7 +392,7 @@
392392
<div><h4 id="sometypesdonothavebuiltinnamessotheymustbeimported">Some types do not have built-in names, so they must be imported:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> types <span class="hljs-keyword">import</span> FunctionType, MethodType, LambdaType, GeneratorType
393393
</code></pre></div>
394394

395-
<div><h3 id="abc">ABC</h3><p><strong>An abstract base class introduces virtual subclasses that don’t inherit from it, but are still recognized by isinstance() and issubclass().</strong></p><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> collections.abc <span class="hljs-keyword">import</span> Sequence, Collection, Iterable
395+
<div><h3 id="abstractbaseclasses">Abstract Base Classes</h3><p><strong>Each abstract base class specifies a set of virtual subclasses. This classes get recognized by isinstance() and issubclass() as subclasses of the ABC, although they are really not.</strong></p><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> collections.abc <span class="hljs-keyword">import</span> Sequence, Collection, Iterable
396396
<span class="hljs-meta">&gt;&gt;&gt; </span>isinstance([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>], Iterable)
397397
<span class="hljs-keyword">True</span>
398398
</code></pre></div>
@@ -670,7 +670,7 @@
670670
</ul>
671671
<div><h3 id="timezone">Timezone</h3><pre><code class="python language-python apache hljs">&lt;tzinfo&gt; = UTC <span class="hljs-comment"># UTC timezone. London without DST.</span>
672672
&lt;tzinfo&gt; = tzlocal() <span class="hljs-comment"># Local timezone. Also gettz().</span>
673-
&lt;tzinfo&gt; = gettz(<span class="hljs-string">'&lt;Cont.&gt;/&lt;City&gt;'</span>) <span class="hljs-comment"># 'Continent/City_Name' timezone or None.</span>
673+
&lt;tzinfo&gt; = gettz(<span class="hljs-string">'&lt;Continent&gt;/&lt;City&gt;'</span>) <span class="hljs-comment"># 'Continent/City_Name' timezone or None.</span>
674674
&lt;DTa&gt; = &lt;DT&gt;.astimezone(&lt;tzinfo&gt;) <span class="hljs-comment"># Datetime, converted to passed timezone.</span>
675675
&lt;Ta/DTa&gt; = &lt;T/DT&gt;.replace(tzinfo=&lt;tzinfo&gt;) <span class="hljs-comment"># Unconverted object with new timezone.</span>
676676
</code></pre></div>
@@ -1055,7 +1055,7 @@
10551055

10561056

10571057
<div><h3 id="sortable">Sortable</h3><ul>
1058-
<li><strong>With total_ordering decorator you only need to provide eq() and one of lt(), gt(), le() or ge() special methods.</strong></li>
1058+
<li><strong>With total_ordering decorator, you only need to provide eq() and one of lt(), gt(), le() or ge() special methods.</strong></li>
10591059
</ul><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> functools <span class="hljs-keyword">import</span> total_ordering
10601060

10611061
<span class="hljs-meta">@total_ordering</span>

pdf/index_for_pdf.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h2 id="index"><a href="#index" name="index">#</a>Index</h2>
66

77
<div style="column-count: 3; width: 960px; page-break-inside: avoid">
88
<h3 id="a">A</h3>
9-
<p><strong>abstract base classes, <a href="#abc">4</a>, <a href="#collectionsabcsequence">19</a></strong><br>
9+
<p><strong>abstract base classes, <a href="#abstractbaseclasses">4</a>, <a href="#collectionsabcsequence">19</a></strong><br>
1010
<strong>all function, <a href="#anyall">11</a></strong><br>
1111
<strong>animation, <a href="#animation">40</a></strong><br>
1212
<strong>any function, <a href="#anyall">11</a></strong><br>
@@ -27,7 +27,7 @@ <h3 id="c">C</h3>
2727
<strong>class, <a href="#type">4</a>, <a href="#class">14</a>-<a href="#collectionsabcsequence">19</a>, <a href="#metaprograming">31</a>-<a href="#metaclass">32</a></strong><br>
2828
<strong>closure, <a href="#closure">12</a></strong><br>
2929
<strong>collection, <a href="#type">4</a>, <a href="#collection">18</a></strong><br>
30-
<strong>collections module, <a href="#counter">2</a>, <a href="#namedtuple">3</a>, <a href="#abc">4</a>, <a href="#collectionsabcsequence">19</a>, <a href="#deque">29</a></strong><br>
30+
<strong>collections module, <a href="#counter">2</a>, <a href="#namedtuple">3</a>, <a href="#abstractbaseclasses">4</a>, <a href="#collectionsabcsequence">19</a>, <a href="#deque">29</a></strong><br>
3131
<strong>combinatorics, <a href="#combinatorics">8</a></strong><br>
3232
<strong>command line arguments, <a href="#commandlinearguments">22</a></strong><br>
3333
<strong>comparable, <a href="#comparable">16</a></strong><br>
@@ -53,7 +53,7 @@ <h3 id="e">E</h3>
5353
<h3 id="f">F</h3>
5454
<p><strong>files, <a href="#file">23</a></strong><br>
5555
<strong>filter function, <a href="#mapfilterreduce">11</a></strong><br>
56-
<strong>floats, <a href="#abc">4</a>, <a href="#floats">6</a>, <a href="#types">7</a></strong><br>
56+
<strong>floats, <a href="#abstractbaseclasses">4</a>, <a href="#floats">6</a>, <a href="#types">7</a></strong><br>
5757
<strong>format, <a href="#format">6</a>-<a href="#comparisonoffloatpresentationtypes">7</a></strong><br>
5858
<strong>functools module, <a href="#mapfilterreduce">11</a>, <a href="#partial">12</a>, <a href="#decorator">13</a>, <a href="#sortable">16</a></strong><br>
5959
<strong>futures, <a href="#threadpool">30</a></strong> </p>
@@ -68,9 +68,9 @@ <h3 id="i">I</h3>
6868
<strong>inline, <a href="#inline">11</a>-<a href="#namedtupleenumdataclass">12</a></strong><br>
6969
<strong>input function, <a href="#input">22</a></strong><br>
7070
<strong>introspection, <a href="#introspection">31</a></strong><br>
71-
<strong>ints, <a href="#abc">4</a>, <a href="#types">7</a>, <a href="#binhex">8</a></strong><br>
71+
<strong>ints, <a href="#abstractbaseclasses">4</a>, <a href="#types">7</a>, <a href="#binhex">8</a></strong><br>
7272
<strong>is operator, <a href="#comparable">16</a></strong><br>
73-
<strong>iterable, <a href="#abc">4</a>, <a href="#iterable">18</a></strong><br>
73+
<strong>iterable, <a href="#abstractbaseclasses">4</a>, <a href="#iterable">18</a></strong><br>
7474
<strong>iterator, <a href="#iterator">3</a>, <a href="#iterator-1">17</a></strong><br>
7575
<strong>itertools module, <a href="#itertools">3</a>, <a href="#combinatorics">8</a></strong> </p>
7676
<h3 id="j">J</h3>

0 commit comments

Comments
 (0)