Brilliant:

from collections import defaultdict

def tree(): return defaultdict(tree)

https://gist.github.com/2012250