We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 908f56a commit 7f7faf1Copy full SHA for 7f7faf1
udapi/core/bundle.py
@@ -116,3 +116,12 @@ def address(self):
116
def draw(self, **kwargs):
117
"""Pretty print the trees using TextModeTrees."""
118
TextModeTrees(**kwargs).process_bundle(self)
119
+
120
+ @property
121
+ def nodes(self):
122
+ """An iterator over all nodes (excluding empty nodes) in all trees in this bundle."""
123
+ for tree in self:
124
+ # tree.descendants is slightly slower than tree._descendants,
125
+ # but it seems safer, see the comment in udapi.core.block.Block.process.process_tree().
126
+ for node in tree.descendants:
127
+ yield node
0 commit comments