Skip to content

Commit 6a532b0

Browse files
committed
Type
1 parent 9ef6c68 commit 6a532b0

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,10 @@ from types import FunctionType, MethodType, LambdaType, GeneratorType
247247

248248
### ABC-s
249249
**Abstract base classes introduce virtual subclasses, that don’t inherit from a class but are still recognized by isinstance().**
250-
```python
251-
from numbers import Integral, Rational, Real, Complex, Number
252-
<bool> = isinstance(<el>, Number)
253-
```
254250

255251
```python
252+
from numbers import Integral, Rational, Real, Complex, Number
256253
from collections.abc import Iterable, Collection, Sequence
257-
<bool> = isinstance(<el>, Iterable)
258254
```
259255

260256

index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,7 @@ <h4 id="sometypesdonothavebuiltinnamessotheymustbeimported">Some types do not ha
319319
<h3 id="abcs">ABC-s</h3>
320320
<p><strong>Abstract base classes introduce virtual subclasses, that don’t inherit from a class but are still recognized by isinstance().</strong></p>
321321
<pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> numbers <span class="hljs-keyword">import</span> Integral, Rational, Real, Complex, Number
322-
&lt;bool&gt; = isinstance(&lt;el&gt;, Number)
323-
</code></pre>
324-
<pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> collections.abc <span class="hljs-keyword">import</span> Iterable, Collection, Sequence
325-
&lt;bool&gt; = isinstance(&lt;el&gt;, Iterable)
322+
<span class="hljs-keyword">from</span> collections.abc <span class="hljs-keyword">import</span> Iterable, Collection, Sequence
326323
</code></pre>
327324
<h2 id="string"><a href="#string" name="string">#</a>String</h2>
328325
<pre><code class="python language-python hljs">&lt;str&gt; = &lt;str&gt;.strip() <span class="hljs-comment"># Strips all whitespace characters from both ends.</span>

0 commit comments

Comments
 (0)