code: def set_maxsize(self, maxsize, **kwargs):
          
          new_cache = self._get_cache_impl(self.impl_name, maxsize, **kwargs)
          self._populate_new_cache(new_cache)
          self.cache = new_cache
docs: Set maxsize. This involves creating a new cache and transferring the items.