clean_indexes() Sort subs and reset their index attribute. Should be called after destructive operations like split or such.
(self)
| 126 | item.shift(*args, **kwargs) |
| 127 | |
| 128 | def clean_indexes(self): |
| 129 | """ |
| 130 | clean_indexes() |
| 131 | |
| 132 | Sort subs and reset their index attribute. Should be called after |
| 133 | destructive operations like split or such. |
| 134 | """ |
| 135 | self.sort() |
| 136 | for index, item in enumerate(self): |
| 137 | item.index = index + 1 |
| 138 | |
| 139 | @property |
| 140 | def text(self): |