def nested_set(base, key_list, value):
    """Set a value in a nested object in base by item sequence."""
    for key in key_list[:-1]:
        base = base.setdefault(key, {})
    base[key_list[-1]] = value
    return base