class SliceExample(object):

    def __getitem__(self, key):
        if isinstance(key, slice):
            return key.start, key.stop
return key
sl = SliceExample()
print(repr(sl[1]))
print(repr(sl[1:2]))
Numpy __getitem__ delayed evaluation and a[-1:] not the same as a[slice(-1, None, none)]