Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
itertools.chain(*files)导致gen_opener()生成器被提前全部消费掉,因此在此场景不适合,参见原文https://www.safaribooksonline.com/library/view/python-cookbook-3rd/9781449357337/ch04s13.html。但仍可以用yield from itertools.chain.from_iterable(files),itertools.chain.from_iterable相对于itertools.chain,它是懒消费的。 见https://stackoverflow.com/questions/15004772/what-is-the-difference-between-chain-and-chain-from-iterable-in-itertools。
- Loading branch information