(self)
| 234 | replaceWith = replace_with # BS3 |
| 235 | |
| 236 | def unwrap(self): |
| 237 | my_parent = self.parent |
| 238 | if not self.parent: |
| 239 | raise ValueError( |
| 240 | "Cannot replace an element with its contents when that" |
| 241 | "element is not part of a tree.") |
| 242 | my_index = self.parent.index(self) |
| 243 | self.extract() |
| 244 | for child in reversed(self.contents[:]): |
| 245 | my_parent.insert(my_index, child) |
| 246 | return self |
| 247 | replace_with_children = unwrap |
| 248 | replaceWithChildren = unwrap # BS3 |
| 249 |