def is_subclass_safe(cls, class_or_tuple) -> bool:
    """Check if `obj` is a sub-class of `base_cls` (safer version)"""
    try:
        return issubclass(cls, class_or_tuple)
    except TypeError:
        return cls is class_or_tuple