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

Skip to content

Commit c1e644b

Browse files
committed
Merge pull request #15 from Byron/make_getitem_handle_slice_for_py3
Make __getitem__ handle slice for Python 3
2 parents 04b2c8e + 8fde5f3 commit c1e644b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

smmap/buf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def __len__(self):
5151
return self._size
5252

5353
def __getitem__(self, i):
54+
if isinstance(i, slice):
55+
return self.__getslice__(i.start or 0, i.stop or self._size)
5456
c = self._c
5557
assert c.is_valid()
5658
if i < 0:

0 commit comments

Comments
 (0)