'Change the current cache size, the value is auto-clamped to [1, *]'

@size.setter
def size(self, size):

    size = max(1, size)
    if (size > self._size):
        self.expand((size - self._size))
    elif (size < self._size):
        self.shrink((self._size - size))
