'Logic for getitem to get the item at offset.
Args:
offset: The offset of the current item, relative to the last one.
Return:
The new item.'

def _get_new_item(self, offset):

    try:
        if ((self._idx + offset) >= 0):
            new = self._items[(self._idx + offset)]
        else:
            raise IndexError
    except IndexError:
        if (self._mode == self.Modes.edge):
            assert (offset != 0)
            if (offset > 0):
                new = self.lastitem()
            else:
                new = self.firstitem()
        elif (self._mode == self.Modes.exception):
            raise
    else:
        self._idx += offset
    return new
