Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f00a776

Browse files
committed
Minor fix for BigArray (now accepting negative indexes)
1 parent 1c69eb5 commit f00a776

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/core/bigarray.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def __getslice__(self, i, j):
7878
return retval
7979

8080
def __getitem__(self, y):
81+
if y < 0:
82+
y += len(self)
8183
index = y / BIGARRAY_CHUNK_LENGTH
8284
offset = y % BIGARRAY_CHUNK_LENGTH
8385
chunk = self.chunks[index]

0 commit comments

Comments
 (0)