| 594 | # class |
| 595 | # __next__ |
| 596 | class CIterNext: |
| 597 | def __init__(self, sec=(1, 2, 3)): |
| 598 | self.sec = sec |
| 599 | self.index = 0 |
| 600 | |
| 601 | def __iter__(self): |
| 602 | return self |
| 603 | |
| 604 | def __next__(self): |
| 605 | if self.index >= len(self.sec): |
| 606 | raise StopIteration |
| 607 | v = self.sec[self.index] |
| 608 | self.index += 1 |
| 609 | return v |
| 610 | |
| 611 | |
| 612 | x = list(range(10)) |