def defaultToNoneOrValue(value, default=''):
    """Convert a value to NoneType if it matches a default.

    Parameters
    ----------
    value : anything
        The value to possibly convert.
    default : anything, optional
        The default to check if NoneType return is necessary.

    Returns
    -------
    anything
        The converted value.
    """
    return None if value == default else value