deep_map.py 文件源码

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

项目:PYKE 作者: muddyfish 项目源码 文件源码
def apply_inf_list(self, a:Node.infinite, b:Node.infinite):
        def apply_iterator(a, b):
            a, a_copy = tee(a, 2)
            b, b_copy = tee(b, 2)
            yield self.run(next(a_copy), [next(b_copy)])
            size = 1
            while 1:
                next_a = next(a_copy)
                next_b = next(b_copy)
                a, new_a = tee(a, 2)
                b, new_b = tee(b, 2)
                yield from (self.run(next(new_a), [next_b]) for i in range(size))
                yield from (self.run(next_a, [next(new_b)]) for i in range(size))
                yield self.run(next_a, [next_b])
                size += 1
        return DummyList(apply_iterator(a, b))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号