def remove(self, item): if self._pending_removals: self._commit_removals() self.data.remove(ref(item))