title: Remove empty dicts in nested dictionary with recursive function
body: <p>I'm trying to remove non-values from a nested dictionary.  My first effort works fine, but unfortunately keys pointing to now empty dicts still persist.</p>
  
  <p>So if i do:</p>
  
  <pre><code>pass1 = stripper(my_dict)
  return stripper(pass1)
  </code></pre>
  
  <p>This works, but i'm thinking a more elegant nested solution might be possible?</p>
  
  <pre><code>def stripper(self, data):
      if isinstance(data, dict):
          d = ({k: stripper(v) for k, v in data.items()
               if v not in [u'', None]})
          if d:
              return d
      else:
          return data
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Failing example, dict below returns as <code>{'foo': 'bar', 'bar': None}</code>:</p>
  
  <pre><code>{
      'foo': 'bar',
      'bar': {
          'foo': None,
          'one': None
      }
  }
  </code></pre>