def mro_hasattr(cls: type, attr: str) -> bool:
    """Check if an attribute exists in a type's class hierarchy

    Args:
        cls (type): The type
        attr (str): The attribute

    Returns:
        bool: True if has the attribute.

    Raises:
        TypeError: Not called on a type
    """

    if not isinstance(cls, type):
        raise TypeError(f"mro_getattr can only be used on types, got {type(cls)}")

    for klass in cls.mro()[1:]:
        if hasattr(klass, attr):
            return True
    return False