def _iter_descendants_preorder(self, is_leaf_fn=None):
to_visit = deque()<EOL>node = self<EOL>while node is not None:<EOL><INDENT>yield node<EOL>if not is_leaf_fn or not is_leaf_fn(node):<EOL><INDENT>to_visit.extendleft(reversed(node.children))<EOL><DEDENT>try:<EOL><INDENT>node = to_visit.popleft()<EOL><DEDENT>except:<EOL><INDENT>node = None<EOL><DEDENT><DEDENT>
Iterator over all descendant nodes.