def _dict_from_path(path, val, delimiter=DEFAULT_TARGET_DELIM):
 nested_dict = _infinitedict()
 keys = path.rsplit(delimiter)
 lastplace = reduce(operator.getitem, keys[:(-1)], nested_dict)
 lastplace[keys[(-1)]] = val
 return nested_dict

def _dict_from_path ( path , val , delimiter = DEFAULT_TARGET_DELIM ) : nested_dict = _infinitedict ( ) keys = path . rsplit ( delimiter ) lastplace = reduce ( operator . getitem , keys [ : ( - 1 ) ] , nested_dict ) lastplace [ keys [ ( - 1 ) ] ] = val return nested_dict
given a lookup string in the form of foo:bar:baz" return a nested dictionary of the appropriate depth with the final segment as a value .