title: OrderedDict KeyError
body: <pre><code>import collections
  
  d = collections.defaultdict(dict)
  
  d["i"]["a"] = "111"
  d["i"]["b"] = "222"
  
  print d
  
  od = collections.OrderedDict()
  
  od["i"]["a"] = "111"
  od["i"]["b"] = "222"
  
  print od
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>defaultdict(&lt;type 'dict'&gt;, {'i': {'a': '111', 'b': '222'}})
  Traceback (most recent call last):
    File "app_main.py", line 51, in run_toplevel
    File "/Users/adam/Desktop/collections.py", line 12, in &lt;module&gt;
      od["i"]["a"] = "111"
  KeyError: 'i'
  </code></pre>
  
  <p>Why the key error with OrderedDict and what I can do about it?</p>
  
  <p>Thanks.</p>