标签:iterator import self imp list pre next ext cti
from collections import Iterator
class IterA(Iterator):
def __init__(self,Itlist):
self.Itlist = Itlist
self.index = 0
def next(self):
if self.index == len(self.Itlist):
raise StopIteration
a = self.Itlist[self.index]
self.index +=1
return a
标签:iterator import self imp list pre next ext cti
原文地址:https://www.cnblogs.com/pxfb/p/9270459.html