title: Iterating over an `OrderedDict` and deleting some of its keys?
body: <p>Suppose I have an <code>OrderedDict</code> <code>od</code> with integer keys and integer values. I want to iterate over <code>od</code> and delete elements of <code>od</code> based on the value I find. Basically what I want to achieve is:</p>
  
  <pre><code>od = {1: 2, 2: 4, 3: 5}
  
  for key in od:
      del od[key]
  </code></pre>
  
  <p>In the end I want <code>od</code> to be equal to <code>{1: 2, 3: 5}</code>. Python does not allow to change the size of an <code>OrderedDict</code> during its iteration. Is it possible to overcome this problem?</p>
  
  <p>I am working with Python 3.5</p>