<div><h4id="sometypesdonothavebuiltinnamessotheymustbeimported">Some types do not have builtin 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
<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
</code></pre></div>
</code></pre></div>
<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
<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