reduce(lambda res, cur: {cur: res}, reversed('foo/bar/baz'.split('/')), 1)"