Remove the node from the tree. Returns the position of the node in its parent's children before it was removed.
(self)
| 136 | self.was_changed = True |
| 137 | |
| 138 | def remove(self): |
| 139 | """ |
| 140 | Remove the node from the tree. Returns the position of the node in its |
| 141 | parent's children before it was removed. |
| 142 | """ |
| 143 | if self.parent: |
| 144 | for i, node in enumerate(self.parent.children): |
| 145 | if node is self: |
| 146 | self.parent.changed() |
| 147 | del self.parent.children[i] |
| 148 | self.parent = None |
| 149 | return i |
| 150 | |
| 151 | @property |
| 152 | def next_sibling(self): |