title: How can I write YAML from dictionary containing munch without "!munch.Munch"?
body: <p>When writing a yaml file from a dictionary containing <code>munch.Munch</code> one gets &quot;!munch.Munch&quot; as part of the output. How can I avoid this behavior?</p>
  <p><strong>Minimal example to show the problem</strong></p>
  <pre><code>data = {&quot;A&quot;:&quot;a&quot;, &quot;B&quot;:munch.Munch({&quot;C&quot;:&quot;c&quot;})}
  with open(&quot;test.yaml&quot;, &quot;w&quot;) as file:
      yaml.dump(data, file)
  </code></pre>
  <p>Produces:</p>
  <pre><code>A: a
  B: !munch.Munch
    C: c
  </code></pre>
  <p>But wanted output is:</p>
  <pre><code>A: a
  B:
    C: c
  </code></pre>
  <p><strong>Unfeasible solutions</strong></p>
  <p>Of course one could simply walk through the dictionary recursively and convert every <code>munch.Munch</code> into a dictionary, but I believe that there is a better solution than that. Writing <code>munch.Munch</code> directly to a yaml file works as intended and the difference between <code>munch.Munch</code> and dict is so tiny - there must be a better way. Any ideas?</p>