(self)
| 142 | oldParent.insert(myIndex, replaceWith) |
| 143 | |
| 144 | def replaceWithChildren(self): |
| 145 | myParent = self.parent |
| 146 | myIndex = self.parent.index(self) |
| 147 | self.extract() |
| 148 | reversedChildren = list(self.contents) |
| 149 | reversedChildren.reverse() |
| 150 | for child in reversedChildren: |
| 151 | myParent.insert(myIndex, child) |
| 152 | |
| 153 | def extract(self): |
| 154 | """Destructively rips this element out of the tree.""" |