file_iterator.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:rltk 作者: usc-isi-i2 项目源码 文件源码
def __copy__(self):
        """
            Clone the iterator include states
        """
        # https://docs.python.org/2/library/itertools.html#itertools.tee
        # tee is not that helpful here, and it will also occupy a lot of memory
        # self._file_handler, new_iter = itertools.tee(self._file_handler)

        new_iter = FileIterator(self._file_path, self._type, **self._kwargs)
        if self._line_count > 0:
            for _ in new_iter:
                if new_iter._line_count == self._line_count:
                    break
        return new_iter
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号