(self)
| 27 | return self |
| 28 | |
| 29 | def __next__(self): |
| 30 | print("Next of", self.x, "is", self.count) |
| 31 | |
| 32 | if len(self.values) > self.count: |
| 33 | self.count += 1 |
| 34 | |
| 35 | return self.values[self.count - 1] |
| 36 | else: |
| 37 | print("Raising StopIteration for", self.x) |
| 38 | |
| 39 | raise StopIteration |
| 40 | |
| 41 | # Python2/3 compatibility. |
| 42 | next = __next__ |