from functools import reduce
import operator


def get_by_path(root: dict, items: list[str | int]) -> dict:
    """Access a nested object in root by item sequence."""
    return reduce(operator.getitem, items, root)