I was reading the gist @https://gist.github.com/2012250
I found the autovivification functionality of it pretty cool. If only I could have a parent reference...
Obviously this was not going to be a one-line tree. But that wasn't the goal
A simple variant:
from collections import defaultdict