title: How to keep the order by updating OrderedDict
body: <p>please tell me.</p>
  
  <p><strong>Description</strong></p>
  
  <p>I'd like to update the value of a variable of type <code>OrderedDict</code> by using the update method of dict.
  However, after executing the update method, the <code>OrderedDict</code> type of the update target variable is lost, and output as expected can not be done.</p>
  
  <p><strong>Question points:</strong></p>
  
  <ol>
  <li>Is it faulty to lose the type of <code>OrderedDict</code>?</li>
  <li>Is there another way to update dict while keeping the type of <code>OrderedDict</code>?</li>
  </ol>
  
  <p>Below is an example of the problem.</p>
  
  <hr>
  
  <pre><code>from collections import OrderedDict
  
  dic = OrderedDict()
  
  dic['a'] = 1
  dic['b'] = OrderedDict()
  dic['b']['b1'] = 2
  dic['b']['b2'] = 3
  dic['b']['b3'] = 4
  
  print(dic)
  &gt; OrderedDict([('a', 1), ('b', OrderedDict([('b1', 2), ('b2', 3), ('b3', 4)]))]) # ok
  
  new_dic = {'a': 2, 'b': {'b1': 3, 'b2': 4, 'b3': 5}}
  print(new_dic)
  &gt; {'a': 2, 'b': {'b1': 3, 'b2': 4, 'b3': 5}}
  
  dic.update(new_dic)
  
  print(dic)
  &gt; OrderedDict([('a', 2), ('b', {'b1': 3, 'b2': 4, 'b3': 5})]) # NG: Type has been lost
  </code></pre>
  
  <hr>