code: def maxsize(self, size):
          
          if size < 0:
              raise ValueError('maxsize must be non-negative')
          with self._lock:
              self._enforce_size_limit(size)
              self._maxsize = size
docs: Resize the cache, evicting the oldest items if necessary.