| 504 | |
| 505 | # test infinite iterator |
| 506 | class Counter(object): |
| 507 | def __init__(self, counter=0): |
| 508 | self.counter = counter |
| 509 | |
| 510 | def __next__(self): |
| 511 | self.counter += 1 |
| 512 | return self.counter |
| 513 | |
| 514 | def __iter__(self): |
| 515 | return self |
| 516 | |
| 517 | |
| 518 | it = zl(Counter(), Counter(3)) |