MCPcopy Create free account
hub / github.com/scanny/python-pptx / insert

Method insert

src/pptx/text/layout.py:156–166  ·  view source on GitHub ↗

Insert a new node containing *value* into this tree such that its structure as a binary search tree is preserved.

(self, value)

Source from the content-addressed store, hash-verified

154 return bst
155
156 def insert(self, value):
157 """
158 Insert a new node containing *value* into this tree such that its
159 structure as a binary search tree is preserved.
160 """
161 side = "_lesser" if value < self.value else "_greater"
162 child = getattr(self, side)
163 if child is None:
164 setattr(self, side, _BinarySearchTree(value))
165 else:
166 child.insert(value)
167
168 def tree(self, level=0, prefix=""):
169 """

Callers 5

_get_child_or_firstFunction · 0.80
_get_child_or_insertFunction · 0.80
conf.pyFile · 0.80

Calls 1

_BinarySearchTreeClass · 0.85

Tested by

no test coverage detected