title: Is it safe to change the iterator dynamically in python?
body: <p>With python, I need to add members in a list dynamically when the list is iterated over:</p>
  
  <pre><code>i = [1,2,3,4,5]
  
  for a in i:
      if a == 1:
          i.append(100)
      print a
  </code></pre>
  
  <p>Is it guaranteed to work correctly?</p>