title: YAML output format of python
body: <p>I use <code>PyYaml</code> to output a <code>YAML</code> file. But it reorder my items. like following</p>
  
  <pre><code>&gt;&gt;&gt; yaml.dump({'3':5, '1':3})
  "{'1': 3, '3': 5}\n"
  </code></pre>
  
  <p>I want to get <code>"{'3': 5, '1': 3}\n"</code>. Can I do that thing </p>
  
  <p><strong>PS</strong>. I have tried the <code>collections.OrderedDict</code>. It's output is not good. Like following</p>
  
  <pre><code>&gt;&gt;&gt; a= collections.OrderedDict()
  &gt;&gt;&gt; a['3']=1
  &gt;&gt;&gt; a['1']=2
  &gt;&gt;&gt; a['5']=2
  &gt;&gt;&gt; yaml.dump(a)
  "!!python/object/apply:collections.OrderedDict\n- - ['3', 1]\n  - ['1', 2]\n  - ['5', 2]\n"
  </code></pre>