We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
objectmodel.Node
def _children_of_type(self, atype: Type = Node, recurse: bool = False, seen: set|None = None) -> Iterable[Node]: if recurse and seen is None: seen = set() for child in self._children(): if isinstance(child, atype): yield child if recurse and isinstance(child, Node) and id(child) not in seen: seen.add(id(child)) yield from child._children_of_type(atype=atype, recurse=True, seen=seen)
The text was updated successfully, but these errors were encountered:
def _children_of_type(self, atype: Type = Node, recurse: bool = False, seen: set|None = None) -> Iterable[Node]: if seen is None: seen = {id(self)} for child in self._children(): if id(child) in seen: continue else: seen.add(id(child)) if isinstance(child, atype): yield child if recurse and isinstance(child, Node): yield from child._children_of_type(atype=atype, recurse=True, seen=seen)
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: