MCPcopy Index your code
hub / github.com/python/cpython / walk

Function walk

Lib/ast.py:400–411  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

398
399
400def 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
414def compare(

Callers 1

increment_linenoFunction · 0.70

Calls 2

iter_child_nodesFunction · 0.85
extendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…