From 6a532b06507d2dc1425bd0255418f9b49250871c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 12 Apr 2019 09:22:04 +0200 Subject: [PATCH] Type --- README.md | 6 +----- index.html | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2b81012..61d19d2 100644 --- a/README.md +++ b/README.md @@ -247,14 +247,10 @@ from types import FunctionType, MethodType, LambdaType, GeneratorType ### ABC-s **Abstract base classes introduce virtual subclasses, that don’t inherit from a class but are still recognized by isinstance().** -```python -from numbers import Integral, Rational, Real, Complex, Number - = isinstance(, Number) -``` ```python +from numbers import Integral, Rational, Real, Complex, Number from collections.abc import Iterable, Collection, Sequence - = isinstance(, Iterable) ``` diff --git a/index.html b/index.html index b457033..4c82d1d 100644 --- a/index.html +++ b/index.html @@ -319,10 +319,7 @@ Point(x=1, y=2

ABC-s

Abstract base classes introduce virtual subclasses, that don’t inherit from a class but are still recognized by isinstance().

from numbers import Integral, Rational, Real, Complex, Number
-<bool> = isinstance(<el>, Number)
-
-
from collections.abc import Iterable, Collection, Sequence
-<bool> = isinstance(<el>, Iterable)
+from collections.abc import Iterable, Collection, Sequence
 

#String

<str>  = <str>.strip()                       # Strips all whitespace characters from both ends.