def range(self, start_key=None, end_key=None, start_inclusive=True,
              end_inclusive=False):
        """A generator for some range of rows"""
        if start_key is not None:
            self.seek(start_key)
            if not start_inclusive and self.key() == start_key:
                self._impl.Next()
        else:
            self.SeekToFirst()
        for row in self:
            if end_key is not None and (row.key > end_key or (
                        not end_inclusive and row.key == end_key)):
                break
            yield row
A generator for some range of rows
pymclevel/leveldb.py