Python radix tree implementation