(self)
| 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.""" |