Source

szoska-test / test_iterator.py

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