(self, y, value)
| 279 | return self.cache.data[offset] |
| 280 | |
| 281 | def __setitem__(self, y, value): |
| 282 | with self._lock: |
| 283 | length = len(self) |
| 284 | if length == 0: |
| 285 | raise IndexError("BigArray index out of range") |
| 286 | |
| 287 | if y < 0: |
| 288 | y += length |
| 289 | |
| 290 | if y < 0 or y >= length: |
| 291 | raise IndexError("BigArray index out of range") |
| 292 | |
| 293 | index = y // self.chunk_length |
| 294 | offset = y % self.chunk_length |
| 295 | chunk = self.chunks[index] |
| 296 | |
| 297 | if isinstance(chunk, list): |
| 298 | chunk[offset] = value |
| 299 | else: |
| 300 | self._checkcache(index) |
| 301 | self.cache.data[offset] = value |
| 302 | self.cache.dirty = True |
| 303 | |
| 304 | def __repr__(self): |
| 305 | return "%s%s" % ("..." if len(self.chunks) > 1 else "", self.chunks[-1].__repr__()) |
nothing calls this directly
no test coverage detected