def __str__(self, depth=0):
    if self.children:
        return str(self.stuff) + '\n' + '\n'.join([(' ' * depth + k + ' ' +
            v.__str__(depth + 1)) for k, v in list(self.children.items())])
Memory Efficient data structure for Trie Implementation