生成器类型
yield 表达式
import itertools def fib(): a, b = 1, 1 while True: yield a a, b = b, a + b assert list(itertools.takewhile(lambda x: x < 100, fib())) == [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]