MCPcopy Create free account
hub / github.com/ActiveState/code / __iter__

Method __iter__

recipes/Python/577898_23_Tree/recipe-577898.py:222–228  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

220 self.lastSearchDepth = 0
221
222 def __iter__(self):
223 stack = [self.root]
224 while len(stack):
225 node = stack.pop()
226 yield node
227 for j in xrange(node.refcnt - 1, -1, -1):
228 stack.append(node.getLink(j))
229
230 def __str__(self):
231 """ String representation of a tree (parentheses form) """

Callers

nothing calls this directly

Calls 4

xrangeClass · 0.85
getLinkMethod · 0.80
popMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected