MCPcopy Index your code
hub / github.com/clips/pattern / replaceWithChildren

Method replaceWithChildren

pattern/web/soup/BeautifulSoup.py:159–166  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

157 oldParent.insert(myIndex, replaceWith)
158
159 def replaceWithChildren(self):
160 myParent = self.parent
161 myIndex = self.parent.index(self)
162 self.extract()
163 reversedChildren = list(self.contents)
164 reversedChildren.reverse()
165 for child in reversedChildren:
166 myParent.insert(myIndex, child)
167
168 def extract(self):
169 """Destructively rips this element out of the tree."""

Callers 1

Calls 4

extractMethod · 0.95
reverseMethod · 0.80
indexMethod · 0.45
insertMethod · 0.45

Tested by 1