lsf.py 文件源码

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

项目:pyimc 作者: oysstu 项目源码 文件源码
def sorted_idx_iter(self, types: List[int]) -> Iterable[int]:
        """
        Returns an iterator of file positions sorted by file position (across different message types)
        :param types: The message types to return, None returns all types
        :return: Generator object for sorted file positions
        """
        if types:
            idx_iters = [self.idx[key] for key in types if key in self.idx]
        else:
            idx_iters = [val for key, val in self.idx.items()]

        # Use the heapq.merge function to return sorted iterator of file indices
        return heapq.merge(*idx_iters)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号