diff --git a/README.md b/README.md index 61d19d2..2f5cebc 100644 --- a/README.md +++ b/README.md @@ -231,8 +231,8 @@ Type * **Type and class are synonymous.** ```python - = type() # Or: = .__class__ - = isinstance(, ) # Also checks subclasses and ABCs. + = type() # Or: .__class__ + = isinstance(, ) # Or: issubclass(type(), ) ``` ```python @@ -246,7 +246,7 @@ 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().** +**Abstract base classes introduce virtual subclasses, that don’t inherit from a class but are still recognized by isinstance() and issubclass().** ```python from numbers import Integral, Rational, Real, Complex, Number diff --git a/index.html b/index.html index 4c82d1d..d3af7c9 100644 --- a/index.html +++ b/index.html @@ -307,8 +307,8 @@ Point(x=1, y=2
  • Every object has a type.
  • Type and class are synonymous.
  • -
    <type>  = type(<el>)                      # Or: <type> = <el>.__class__
    -<bool>  = isinstance(<el>, <type>)        # Also checks subclasses and ABCs.
    +
    <type> = type(<el>)                # Or: <el>.__class__
    +<bool> = isinstance(<el>, <type>)  # Or: issubclass(type(<el>), <type>)
     
    >>> type('a'), 'a'.__class__, str
     (<class 'str'>, <class 'str'>, <class 'str'>)
    @@ -317,7 +317,7 @@ Point(x=1, y=2
     
    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().

    +

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

    from numbers import Integral, Rational, Real, Complex, Number
     from collections.abc import Iterable, Collection, Sequence