StackOverflow 文档 Python Language 教程 Iterables 和 Iterators 迭代器不是可重入的 迭代器不是可重入的 Created: November-22, 2018 placeholderCopydef gen(): yield 1 iterable = gen() for a in iterable: print a # What was the first item of iterable? No way to get it now. # Only to get a new iterator gen() 什么是可迭代的