from typing import List


def _read_from_path(config:dict, path:List[str]):
    """Reads nested dictionary.
    Eg `_read_config({'foo':{'bar':1}}, ['foo','bar']) = 1`
    """
    if len(path) == 1:
        return config[path[0]]
    return _read_from_path(config[path[0]], path[1:])