My favorite trie implementation defines the trie as:
```
from collections import defaultdict
def trie():
return defaultdict(trie)
```Yeah, a `trie` is a dictionary whose values are tries. And the values are automatically created by reference:
```
>>> t = trie()
>>> t["e"]["a"]["r"]["t"]["h"]
defaultdict(<function trie at 0x10d5ebc40>, {})
```