Recursively yield node and all its children in depth-first order.
(node: ast.AST)
| 548 | |
| 549 | |
| 550 | def traverse_node(node: ast.AST) -> Iterator[ast.AST]: |
| 551 | """Recursively yield node and all its children in depth-first order.""" |
| 552 | yield node |
| 553 | for child in ast.iter_child_nodes(node): |
| 554 | yield from traverse_node(child) |
| 555 | |
| 556 | |
| 557 | @functools.lru_cache(maxsize=1) |