def next(self):
if not hasattr(self, '<STR_LIT>'):<EOL><INDENT>self.__iter__()<EOL><DEDENT>if self._cursor == len(self):<EOL><INDENT>raise StopIteration()<EOL><DEDENT>if self._buffer_idx == len(self._buffer):<EOL><INDENT>self.execute(self._page_offset + self._buffer_idx)<EOL>self._buffer_idx = <NUM_LIT:0><EOL><DEDENT>self._cursor += <NUM_LIT:1><EOL>self._buffer_idx += <NUM_LIT:1><EOL>return self._buffer[self._buffer_idx - <NUM_LIT:1>]<EOL>
Allows the Query object to be an iterable.

This method will iterate through a cached result set
and fetch successive pages as required.

A `StopIteration` exception will be raised when there aren't
any more results available or when the requested result
slice range or limit has been fetched.

Returns: The next result.