title: Changing a collection.Counter during enumeration?
body: <pre><code>counter = Counter()
  // fill data into counter
  for a, b in counter.most_common():
      if (b &gt; 1):
          counter[a] = np.log(b)
      else:
          counter[a] = -np.log((1 / (b+0.01)))
  </code></pre>
  
  <p>As I see, this is safe, based on my trial. No bad thing happens when I change the collection while I am enumerating it. In other languages, in each cycle of the <code>for</code>, the <code>counter.most_common()</code> value is evaluated.</p>
  
  <p>Doesn't this happen in Python as well?</p>