MCPcopy Index your code
hub / github.com/RustPython/RustPython / walk

Function walk

Lib/ast.py:386–397  ·  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

384
385
386def walk(node):
387 """
388 Recursively yield all descendant nodes in the tree starting at *node*
389 (including *node* itself), in no specified order. This is useful if you
390 only want to modify nodes in place and don't care about the context.
391 """
392 from collections import deque
393 todo = deque([node])
394 while todo:
395 node = todo.popleft()
396 todo.extend(iter_child_nodes(node))
397 yield node
398
399
400def compare(

Callers 1

increment_linenoFunction · 0.70

Calls 3

iter_child_nodesFunction · 0.85
popleftMethod · 0.80
extendMethod · 0.45

Tested by

no test coverage detected