1. Daniel Szoska
  2. szoska-test

Source

szoska-test / test_iterator.py

class itertest(object):
    
    def __init__(self):
        self.l = [1, 2, 3, 4, 5]
        
    def __iter__(self):
        for i in self.l:
            yield i
            
it = itertest()
for i in it:
    print i