Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context.
(node)
| 398 | |
| 399 | |
| 400 | def walk(node): |
| 401 | """ |
| 402 | Recursively yield all descendant nodes in the tree starting at *node* |
| 403 | (including *node* itself), in no specified order. This is useful if you |
| 404 | only want to modify nodes in place and don't care about the context. |
| 405 | """ |
| 406 | from collections import deque |
| 407 | todo = deque([node]) |
| 408 | while todo: |
| 409 | node = todo.popleft() |
| 410 | todo.extend(iter_child_nodes(node)) |
| 411 | yield node |
| 412 | |
| 413 | |
| 414 | def compare( |
no test coverage detected
searching dependent graphs…