zhanghaitao1
6/3/2019 - 2:04 PM

yield, generator, yield from, iterable

yield, generator, yield from, iterable


def chain1(*iterables):
    for it in iterables:
        for i in it:
            yield i

def chain2(*iterables):
    for i in iterables:
        yield from i