title: Should I return an empty dict instead of None?
body: <p>I have a method that currently returns <code>None</code> or a <code>dict</code>.</p>
  
  <pre><code>result,error = o.apply('grammar')
  </code></pre>
  
  <p>The caller currently has to check for the existence of two keys to decide what kind of object was returned.</p>
  
  <pre><code>if 'imperial' in result:
      # yay
  elif 'west' in result:
      # yahoo
  else:
      # something wrong?
  </code></pre>
  
  <p>Because result can be <code>None</code>, I'm thinking of returning an empty dict instead, so the caller does not need to check for that. What do you think ?</p>
  
  <p>For comparison, in the <code>re</code> module, the result of calling <code>match</code> can result in <code>None</code>.</p>
  
  <pre><code>p = re.compile('\w+')
  m = p.match( 'whatever' )
  </code></pre>
  
  <p>But in this case, <code>m</code> is an object instance. In my case, I am returning a dict which should either be empty or have some entries.</p>