from pathlib import Path


def delta_path(base_path: Path, item_path: Path, new_base_path: Path) -> Path:
    """
    Removes a base path from an item, and appends result to a new path

    :param base_path: The :py:class:`pathlib.Path` to be removed from `item_path`
    :param item_path: The :py:class:`pathlib.Path` to be delta-ed
    :param new_base_path: The new base :py:class:`pathlib.Path` for `item_path`.
    :raises ValueError: If base_path is not a sub-path of item_path.
    :return: The new combined path.
    """

    path_stub = item_path.relative_to(base_path)
    new_item_path = new_base_path / path_stub
    return new_item_path