code: def _protect_consolidate(self, f):
          
          blocks_before = len(self._data.blocks)
          result = f()
          if len(self._data.blocks) != blocks_before:
              self._clear_item_cache()
          return result
docs: Consolidate _data -- if the blocks have changed, then clear the
          cache