class Lazy_list: def __init__(self, iterator): self.data = [ ] self.iterator = iterator def __getitem__(self, index): while len(self.data) <= index: self.data.append( self.iterator.next() ) return self.data[index]
class Lazy_list: def __init__(self, iterator): self.data = [ ] self.iterator = iterator def __getitem__(self, index): while len(self.data) <= index: self.data.append( self.iterator.next() ) return self.data[index]