title: Returning None or a tuple and unpacking
body: <p>I am always annoyed by this fact:</p>
  
  <pre><code>$ cat foo.py
  def foo(flag):
      if flag:
          return (1,2)
      else:
          return None
  
  first, second = foo(True)
  first, second = foo(False)
  
  $ python foo.py
  Traceback (most recent call last):
    File "foo.py", line 8, in &lt;module&gt;
      first, second = foo(False)
  TypeError: 'NoneType' object is not iterable
  </code></pre>
  
  <p>The fact is that in order to correctly unpack without troubles I have either to catch the TypeError or to have something like</p>
  
  <pre><code>values = foo(False)
  if values is not None:
      first, second = values
  </code></pre>
  
  <p>Which is kind of annoying. Is there a trick to improve this situation (e.g. to so set both first and second to None without having foo returning (None, None)) or a suggestion about the best design strategy for cases like the one I present ? *variables maybe ?</p>