def _issubclass_2(subclass, superclass, bound_Generic, bound_typevars,
            bound_typevars_readonly, follow_fwd_refs, _recursion_check):
    """Helper for _issubclass, a.k.a pytypes.issubtype.
    """
    if is_Tuple(superclass):
        return _issubclass_Tuple(subclass, superclass, bound_Generic, bound_typevars,
                bound_typevars_readonly, follow_fwd_refs, _recursion_check)
    if is_Union(superclass):
        return _issubclass_Union(subclass, superclass, bound_Generic, bound_typevars,
                bound_typevars_readonly, follow_fwd_refs, _recursion_check)
    if is_Union(subclass):
        return all(_issubclass(t, superclass, bound_Generic, bound_typevars,
                bound_typevars_readonly, follow_fwd_refs, _recursion_check) \
                for t in get_Union_params(subclass))
    if is_Generic(superclass):
        cls = superclass.__origin__ if not superclass.__origin__ is None else superclass
        # We would rather use issubclass(superclass.__origin__, Mapping), but that's somehow erroneous
        if pytypes.covariant_Mapping and (_has_base(cls, Mapping) or
                    # Python 3.7 maps everything to collections.abc:
                    (cls in _extra_dict and issubclass(cls, collections.abc.Mapping))):
            return _issubclass_Mapping_covariant(subclass, superclass,
                    bound_Generic, bound_typevars,
                    bound_typevars_readonly, follow_fwd_refs,
                    _recursion_check)
        else:
            return _issubclass_Generic(subclass, superclass, bound_Generic, bound_typevars,
                    bound_typevars_readonly, follow_fwd_refs, _recursion_check)
    if subclass in _extra_dict:
        subclass = _extra_dict[subclass]
    try:
        return issubclass(subclass, superclass)
    except TypeError:
        if not is_Type(subclass):
            # For Python 3.7, types from typing are not types.
            # So issubclass emits TypeError: issubclass() arg 1 must be a class
            raise TypeError("Invalid type declaration: %s, %s" %
                        (type_str(subclass), type_str(superclass)))
        return False