From f00a776d8dc1348f648ebf0ef9f952d7529d7ef5 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 7 Jul 2012 10:35:29 +0200 Subject: [PATCH] Minor fix for BigArray (now accepting negative indexes) --- lib/core/bigarray.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/core/bigarray.py b/lib/core/bigarray.py index 05a5d04a0..f44e96f3f 100644 --- a/lib/core/bigarray.py +++ b/lib/core/bigarray.py @@ -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]