title: Function returning a tuple or None: how to call that function nicely?
body: <p>Suppose the following:</p>
  
  <pre><code>def MyFunc(a):
    if a &lt; 0:
      return None
    return (a+1, a+2, a+3)
  
  v1, v2, v3 = MyFunc()
  # Bad ofcourse, if the result was None
  </code></pre>
  
  <p>What is the best way to define a function that returns a tuple and yet can be nicely called. Currently, I could do this:</p>
  
  <pre><code>
  r = MyFunc()
  if r:
    v1, v2, v3 = r
  else:
    # bad!!
    pass
  </code></pre>
  
  <p>What I don't like about this is that I have to use a single variable and then unpack it.</p>
  
  <p>Another solution is I could have the function return a tuple full of Nones so that the caller can nicely unpack....</p>
  
  <p>Anyone can suggest a better design?</p>