def dfs(self):
yield (self.root, None)<EOL>todo = [(self.root[char], self.root) for char in self.root]<EOL>while todo:<EOL><INDENT>current, parent = todo.pop()<EOL>yield (current, parent)<EOL>for char in current:<EOL><INDENT>todo.append((current[char], current))<EOL><DEDENT><DEDENT>
Depth-first search generator.  Yields `(node, parent)` for every
node in the tree, beginning with `(self.root, None)`.