title: How to pass tuple to function as separate variables
body: <p>When returning multiple variables from a Python function, returning a tuple is the most convenient solution to me. However, it lacks convenience when chaining the return value with another function taking separate variables as input. For example, say we have </p>
  
  <pre><code>def foo():
      return (1,2)
  
  def sum(a, b):
      return a+b
  </code></pre>
  
  <p>And in this case, the following chaining doesn't work</p>
  
  <pre><code>sum(foo())
  </code></pre>
  
  <p>I know one solution, namely to change the function <code>sum</code> to take a tuple as input rather than 2 vars, i.e.</p>
  
  <pre><code>def sum2((a, b)):
      return a+b
  </code></pre>
  
  <p>Now the chaining <code>sum2(foo())</code> works, but it's a bit awkward, isn't it? I wound rather change <code>foo()</code> because <code>sum()</code> might has been used by others. What is a nice solution to this?</p>