def _compare_recursive(old, new):
    """Deep comparison between objects; assumes that `new` contains
    user defined parameters so only keys which exist in `new` will be
    compared. Returns `True` if they differ. Else, `False`.
    """
    if isinstance(new, dict):
        for key in six.iterkeys(new):
            try:
                if _compare_recursive(old[key], new[key]):
                    return True
            except (KeyError, TypeError):
                return True

    elif isinstance(new, list) or isinstance(new, tuple):
        for i, item in enumerate(new):
            try:
                if _compare_recursive(old[i], item):
                    return True
            except (IndexError, TypeError):
                return True
    else:
        return old != new

    return False
Deep comparison between objects; assumes that `new` contains
    user defined parameters so only keys which exist in `new` will be
    compared. Returns `True` if they differ. Else, `False`.