(node, path)
| 196 | |
| 197 | # Turn the tree into a list of Path instances. |
| 198 | def _walk(node, path): |
| 199 | for prefix, child in node.items(): |
| 200 | yield from _walk(child, [*path, prefix]) |
| 201 | if not node: |
| 202 | yield Path(*path) |
| 203 | |
| 204 | return tuple(_walk(tree, ())) |
| 205 |