As a further optimization in replace_with - because you're swapping one for one, extract removes the removed item from the cache, insert adds the inserted item to the cache, the cache doesn't actually get any more stale.
``` old_parent = self.parent my_index = self.parent.index(self) + last_stale = old_parent._contents_cache_stale self.extract() old_parent.insert(my_index, replace_with) + old_parent._contents_cache_stale = last_stale return self ```
Cheers, Luke
As a further optimization in replace_with - because you're swapping one for one, extract removes the removed item from the cache, insert adds the inserted item to the cache, the cache doesn't actually get any more stale.
``` index(self) _contents_ cache_stale
self.extract( )
old_parent. insert( my_index, replace_with) _contents_ cache_stale = last_stale
old_parent = self.parent
my_index = self.parent.
+ last_stale = old_parent.
+ old_parent.
return self
```
Cheers,
Luke