(self, y)
| 257 | self.chunks.append(chunk) |
| 258 | |
| 259 | def __getitem__(self, y): |
| 260 | with self._lock: |
| 261 | length = len(self) |
| 262 | if length == 0: |
| 263 | raise IndexError("BigArray index out of range") |
| 264 | |
| 265 | if y < 0: |
| 266 | y += length |
| 267 | |
| 268 | if y < 0 or y >= length: |
| 269 | raise IndexError("BigArray index out of range") |
| 270 | |
| 271 | index = y // self.chunk_length |
| 272 | offset = y % self.chunk_length |
| 273 | chunk = self.chunks[index] |
| 274 | |
| 275 | if isinstance(chunk, list): |
| 276 | return chunk[offset] |
| 277 | else: |
| 278 | self._checkcache(index) |
| 279 | return self.cache.data[offset] |
| 280 | |
| 281 | def __setitem__(self, y, value): |
| 282 | with self._lock: |
nothing calls this directly
no test coverage detected