diff --git a/README.md b/README.md index 4fd9483..3afb32e 100644 --- a/README.md +++ b/README.md @@ -245,12 +245,19 @@ Type 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() and issubclass().** +### ABC +**An abstract base class introduces virtual subclasses, that don’t inherit from it but are still recognized by isinstance() and issubclass().** ```python from numbers import Integral, Rational, Real, Complex, Number -from collections.abc import Iterable, Collection, Sequence +from collections.abc import Sequence, Collection, Iterable +``` + +```python +>>> isinstance(123, Number) +True +>>> isinstance([1, 2, 3], Iterable) +True ``` diff --git a/index.html b/index.html index 3de0206..be132fc 100644 --- a/index.html +++ b/index.html @@ -316,10 +316,15 @@ Point(x=1, y=2

Some types do not have builtin names, so they must be imported:

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() and issubclass().

+

ABC

+

An abstract base class introduces virtual subclasses, that don’t inherit from it but are still recognized by isinstance() and issubclass().

from numbers import Integral, Rational, Real, Complex, Number
-from collections.abc import Iterable, Collection, Sequence
+from collections.abc import Sequence, Collection, Iterable
+
+
>>> isinstance(123, Number)
+True
+>>> isinstance([1, 2, 3], Iterable)
+True
 

#String

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