To avoid the repetition, this could be written as:

```python
for k in key_split[:-1]:
    if k not in cur_dict:  
        # so that derived classes remain true to type
        cur_dict[k] = self.__class__()
    cur_dict = cur_dict[k]
```