code: def next(self):
          
          try:
              result = self.data[self.index]
          except IndexError:
              self.index = 0
              raise StopIteration
          self.index += 1
          return result
docs: Implementation of next method from Iterator.
  
          :return: Result
          :raises: StopIteration if IndexError occurs.