```python
class Iters:
def __init__(self, value):
self.data = value
def __iter__(self):
print('iter=>', end='')
self.ix = 0
return self
def __next__(self):
print( 'next:', end=' ')
if self.ix== len(self.data): raise StopIteration
item = self.data[self.ix]
self.ix += 1
return item
X = Iters([1, 2, 3, 4, 5])
heihei = ([i ** 2 for i in X])
print ('\n====================')
print (heihei)
```
[symons@symons_laptop symons]$ python
haha.pyiter=>next: next: next: next: next: next:
====================
[1, 4, 9, 16, 25]
看这个代码和运行结果就知道啦