from typing import Dict


def recursive_update(old: Dict, new: Dict):
    """Recursively update a dictionary."""

    for key, value in new.items():
        if isinstance(value, dict):
            if key in old:
                recursive_update(old[key], value)
            else:
                old[key] = value
        elif isinstance(value, list):
            if key in old:
                old[key][:] = value
            else:
                old[key] = value
        else:
            old[key] = value

    return old