def expand_list(_list):
    """
    Convert list of '.' separated values to a nested dict.

    Taken from SO article which I now can't find, this will take a list
    and return a dictionary which contains an empty dict as each leaf
    node.

        >>> expand_list(['a', 'b.c'])
        {
            'a': {},
            'b': {
                'c': {}
            }
        }

    """
    assert isinstance(_list, list), "arg must be a list"
    tree = {}
    for item in _list:
        t = tree
        for part in item.split('.'):
            t = t.setdefault(part, {})
    return tree