Minor fix for BigArray (now accepting negative indexes)

This commit is contained in:
Miroslav Stampar 2012-07-07 10:35:29 +02:00
parent 1c69eb5d30
commit f00a776d8d

View File

@ -78,6 +78,8 @@ class BigArray(list):
return retval
def __getitem__(self, y):
if y < 0:
y += len(self)
index = y / BIGARRAY_CHUNK_LENGTH
offset = y % BIGARRAY_CHUNK_LENGTH
chunk = self.chunks[index]