

def next(self):
    if self.__empty:
        raise StopIteration
    db = self.__collection.database
    if (len(self.__data) or self._refresh()):
        if self.__manipulate:
            return db._fix_outgoing(self.__data.popleft(), self.__collection)
        else:
            return self.__data.popleft()
    else:
        raise StopIteration

dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py Cursor.next/original