You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<iter>= count(start=0, step=1) # Returns incremented value endlessly.
208
+
<iter>= count(start=0, step=1) # Returns updated value endlessly. Accepts floats.
209
209
<iter>= repeat(<el> [, times]) # Returns element endlessly or 'times' times.
210
210
<iter>= cycle(<collection>) # Repeats the sequence endlessly.
211
211
```
@@ -261,8 +261,8 @@ Type
261
261
from types import FunctionType, MethodType, LambdaType, GeneratorType
262
262
```
263
263
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.**
Copy file name to clipboardExpand all lines: index.html
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -250,7 +250,7 @@
250
250
list_of_chars = list(<str>)
251
251
</code></pre>
252
252
<ul>
253
-
<li><strong>Module <ahref="#operator">operator</a> provides functions itemgetter() and mul() that offer the same functionality as lambda expressions above.</strong></li>
253
+
<li><strong>Module <ahref="#operator">operator</a> provides functions itemgetter() and mul() that offer the same functionality as <ahref="#lambda">lambda</a> expressions above.</strong></li>
254
254
</ul>
255
255
<pre><codeclass="python language-python hljs"><int> = <list>.count(<el>) <spanclass="hljs-comment"># Returns number of occurrences. Also works on strings.</span>
256
256
index = <list>.index(<el>) <spanclass="hljs-comment"># Returns index of first occurrence or raises ValueError.</span>
<iter> = repeat(<el> [, times]) <spanclass="hljs-comment"># Returns element endlessly or 'times' times.</span>
358
358
<iter> = cycle(<collection>) <spanclass="hljs-comment"># Repeats the sequence endlessly.</span>
359
359
</code></pre>
@@ -392,7 +392,7 @@
392
392
<div><h4id="sometypesdonothavebuiltinnamessotheymustbeimported">Some types do not have built-in names, so they must be imported:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> types <spanclass="hljs-keyword">import</span> FunctionType, MethodType, LambdaType, GeneratorType
393
393
</code></pre></div>
394
394
395
-
<div><h3id="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><codeclass="python language-python hljs"><spanclass="hljs-meta">>>> </span><spanclass="hljs-keyword">from</span> collections.abc <spanclass="hljs-keyword">import</span> Sequence, Collection, Iterable
395
+
<div><h3id="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><codeclass="python language-python hljs"><spanclass="hljs-meta">>>> </span><spanclass="hljs-keyword">from</span> collections.abc <spanclass="hljs-keyword">import</span> Sequence, Collection, Iterable
<div><h3id="timezone">Timezone</h3><pre><codeclass="python language-python apache hljs"><tzinfo> = UTC <spanclass="hljs-comment"># UTC timezone. London without DST.</span>
672
672
<tzinfo> = tzlocal() <spanclass="hljs-comment"># Local timezone. Also gettz().</span>
673
-
<tzinfo> = gettz(<spanclass="hljs-string">'<Cont.>/<City>'</span>)<spanclass="hljs-comment"># 'Continent/City_Name' timezone or None.</span>
673
+
<tzinfo> = gettz(<spanclass="hljs-string">'<Continent>/<City>'</span>) <spanclass="hljs-comment"># 'Continent/City_Name' timezone or None.</span>
674
674
<DTa> = <DT>.astimezone(<tzinfo>) <spanclass="hljs-comment"># Datetime, converted to passed timezone.</span>
675
675
<Ta/DTa> = <T/DT>.replace(tzinfo=<tzinfo>) <spanclass="hljs-comment"># Unconverted object with new timezone.</span>
676
676
</code></pre></div>
@@ -1055,7 +1055,7 @@
1055
1055
1056
1056
1057
1057
<div><h3id="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>
0 commit comments