def __subclasscheck__(cls, subclass):
<EOL>if subclass in cls._abc_cache:<EOL><INDENT>return True<EOL><DEDENT>if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter:<EOL><INDENT>cls._abc_negative_cache = _weakrefset.WeakSet()<EOL>cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter<EOL><DEDENT>elif subclass in cls._abc_negative_cache:<EOL><INDENT>return False<EOL><DEDENT>ok = cls.__subclasshook__(subclass)<EOL>if ok is not NotImplemented:<EOL><INDENT>assert isinstance(ok, bool)<EOL>if ok:<EOL><INDENT>cls._abc_cache.add(subclass)<EOL><DEDENT>else:<EOL><INDENT>cls._abc_negative_cache.add(subclass)<EOL><DEDENT>return ok<EOL><DEDENT>if cls in getattr(subclass, '<STR_LIT>', ()):<EOL><INDENT>cls._abc_cache.add(subclass)<EOL>return True<EOL><DEDENT>for rcls in cls._abc_registry:<EOL><INDENT>if issubclass(subclass, rcls):<EOL><INDENT>cls._abc_cache.add(subclass)<EOL>return True<EOL><DEDENT><DEDENT>for scls in cls.__subclasses__():<EOL><INDENT>if issubclass(subclass, scls):<EOL><INDENT>cls._abc_cache.add(subclass)<EOL>return True<EOL><DEDENT><DEDENT>cls._abc_negative_cache.add(subclass)<EOL>return False<EOL>
Override for issubclass(subclass, cls).