Skip to content
Snippets Groups Projects
Commit c3d8089e authored by Ladislav Lhotka's avatar Ladislav Lhotka
Browse files

Change data_children method to return MutableSet.

parent f81248ad
No related branches found
No related tags found
No related merge requests found
......@@ -222,14 +222,14 @@ class InternalNode(SchemaNode):
res = c.get_data_child(name, ns)
if res: return res
def data_children(self) -> List["DataNode"]:
"""Return the list of all data nodes directly under the receiver."""
res = []
def data_children(self) -> MutableSet["DataNode"]:
"""Return the set of all data nodes directly under the receiver."""
res = set()
for c in self.children.values():
if isinstance(c, DataNode):
res.append(c)
res.add(c)
else:
res.extend(c.data_children())
res.update(c.data_children())
return res
def _post_process(self) -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment