我在合并和拆分部分偶然发现了这段代码.
from itertools import *
def make_iterables_to_chain():
yield [1, 2, 3]
yield ['a', 'b', 'c']
for i in chain.from_iterable(make_iterables_to_chain()):
print(i, end=' ')
print()
我不明白make_iterables_to_chain()是如何工作的.它包含两个yield 率声明,它是如何工作的?
救命啊!