Recursively yield node and all its children in depth-first order.
(node: ast.AST)
| 542 | |
| 543 | |
| 544 | def traverse_node(node: ast.AST) -> Iterator[ast.AST]: |
| 545 | """Recursively yield node and all its children in depth-first order.""" |
| 546 | yield node |
| 547 | for child in ast.iter_child_nodes(node): |
| 548 | yield from traverse_node(child) |
| 549 | |
| 550 | |
| 551 | @functools.lru_cache(maxsize=1) |