大可把这两个问题分开来看
next, 迭代器,生成器这些是一组问题
__next__, __iter__, __add__, __sub__
这些方法是另一组问题,这些套路用足,会显得非常pythonic
【 在 HYNOS 的大作中提到: 】
: 我可能没理解对这些代码的意思。。
: 我的问题其实就是这句话是什么意思:
: If __next__() is used (typically via either a for or the next() builtin) then the result is None.
: ...................
--
FROM 103.40.221.*