title: How to make iterator to start from a specific index?
body: <p>I want to use iterator over a string from a specific index which is not the beginning, without using slicing. Is there a way doing this? I'm using python 3.2</p>
  
  <p><em><strong>Edit:</em></strong> I need to write a  generator function that gets 2 arguments: iterator over an iterable consisted of chars, which may be infinite, and a pattern.
  the function need to return the indexes of the starting occurrence of the pattern in the iterable. I name the generator g for the rest of the question.
  <strong>if the pattern length is m, the efficiency of the func should be O(m)</strong></p>
  
  <p>for exmaple: string: abababab, pattern: abab</p>
  
  <p>so we will get:</p>
  
  <p>next(g)</p>
  
  <p>0</p>
  
  <p>next(g)</p>
  
  <p>2</p>
  
  <p>next(g)</p>
  
  <p>4</p>