from typing import Any


def setattr_changed(obj: Any, field: str, value: Any) -> bool:
    """
    Set an attribute on an object only if the value does not match provided.

    Parameters
    ----------
    obj : object
    field : str
        The name of the attribute on ``obj`` to set.
    value : object

    Returns
    -------
    bool
        True if the attribute was set; otherwise False.

    """
    if getattr(obj, field) != value:
        setattr(obj, field, value)
        return True
    return False