MCPcopy Create free account
hub / github.com/datacamp/pythonwhat / add_child

Method add_child

pythonwhat/probe.py:141–147  ·  view source on GitHub ↗
(self, child)

Source from the content-addressed store, hash-verified

139 return index
140
141 def add_child(self, child):
142 # since it is a tree, there is only one parent
143 # note this means we do not allow edges between same layer units
144 if child.parent:
145 child.parent.remove_child(child)
146 child.parent = self
147 self.child_list.append(child)
148
149 def descend(self, include_me=True):
150 """Descend depth first into all child nodes"""

Callers 2

__call__Method · 0.80
build_sub_test_nodesMethod · 0.80

Calls 1

remove_childMethod · 0.80

Tested by

no test coverage detected