title: Dictionary merge by updating but not overwriting if value exists
body: <p>If I have 2 dicts as follows:</p>
  <pre><code>d1 = {'a': 2, 'b': 4}
  d2 = {'a': 2, 'b': ''}
  </code></pre>
  <p>In order to 'merge' them:</p>
  <pre><code>dict(d1.items() + d2.items())
  </code></pre>
  <p>results in</p>
  <pre><code>{'a': 2, 'b': ''}
  </code></pre>
  <p>But what should I do if I would like to compare each value of the two dictionaries and only update <code>d2</code> into <code>d1</code> if values in <code>d1</code> are empty/<code>None</code>/<code>''</code>?</p>
  <p>When the same key exists, I would like to only maintain the numerical value (either from <code>d1</code> or <code>d2</code>) instead of the empty value. If both values are empty, then no problems maintaining the empty value. If both have values, then <code>d1</code>-value should stay.</p>
  <p>i.e.</p>
  <pre><code>d1 = {'a': 2, 'b': 8, 'c': ''}
  d2 = {'a': 2, 'b': '', 'c': ''}
  </code></pre>
  <p>should result in</p>
  <pre><code>{'a': 2, 'b': 8, 'c': ''}
  </code></pre>
  <p>where 8 is not overwritten by <code>''</code>.</p>