迭代器必备:iter 、next
上一节
下一节
分析示例:
class M:
def __iter__(self):
print('iter被调用')
return self
def __next__(self):
print('next被调用')
for i in M():
pass


