'apply LIMIT/OFFSET to the ``Query`` based on a "
"range and return the newly resulting ``Query``.'

@_generative(_no_statement_condition)
def slice(self, start, stop):

    if ((start is not None) and (stop is not None)):
        self._offset = ((self._offset or 0) + start)
        self._limit = (stop - start)
    elif ((start is None) and (stop is not None)):
        self._limit = stop
    elif ((start is not None) and (stop is None)):
        self._offset = ((self._offset or 0) + start)
    if (self._offset == 0):
        self._offset = None
