'Fetch up to size rows from the cursor. Result set may be smaller
than size. If size is not defined, cursor.arraysize is used.'

def fetchmany(self, size=None):

    self._check_executed()
    end = (self.rownumber + (size or self.arraysize))
    result = self._rows[self.rownumber:end]
    self.rownumber = min(end, len(self._rows))
    return result
