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

Method removeValue

recipes/Python/577898_23_Tree/recipe-577898.py:145–156  ·  view source on GitHub ↗

Remove value from node

(self, val)

Source from the content-addressed store, hash-verified

143 return self
144
145 def removeValue(self, val):
146 """ Remove value from node """
147 if self.contains(val):
148 idx = self.values.index(val)
149 if idx == 0:
150 self.values[0], self.values[1], self.values[2] = self.values[1], self.values[2], None
151 elif idx == 1:
152 self.values[1], self.values[2] = self.values[2], None
153 else:
154 self.values[2] = None
155 self.valcnt -= 1
156 return self
157
158 def removeLink(self, node):
159 """ Remove link from self to another node """

Callers 2

__fixNodeRemoveMethod · 0.45
removeValueMethod · 0.45

Calls 2

containsMethod · 0.95
indexMethod · 0.45

Tested by

no test coverage detected