def set_deep(instance, path, value):
    """
    Do NOT use this helper in your code.
    It's extremely primitive and wouldn't work properly with most Mappings.
    """
    path = path.split('.')
    for path_segment in path[:-1]:
        if path_segment not in instance:
            instance[path_segment] = {}
        instance = instance[path_segment]
    instance[path[-1]] = value
