it looks like `sum` was the perfect choice here.  `itertools.chain` merges the lists into a single sequence but doesn't traverse the leaves of the tree (it keep the lists within the list).