title: What is the good python3 equivalent for auto tuple unpacking in lambda?
body: <p>Consider the following python2 code</p>
  <pre><code>In [5]: points = [ (1,2), (2,3)]
  
  In [6]: min(points, key=lambda (x, y): (x*x + y*y))
  Out[6]: (1, 2)
  </code></pre>
  <p>This is not supported in python3 and I have to do the following:</p>
  <pre><code>&gt;&gt;&gt; min(points, key=lambda p: p[0]*p[0] + p[1]*p[1])
  (1, 2)
  </code></pre>
  <p>This is very ugly. If the lambda was a function, I could do</p>
  <pre><code>def some_name_to_think_of(p):
    x, y = p
    return x*x + y*y
  </code></pre>
  <p>Removing this feature in python3 forces the code to either do the ugly way(with magic indexes) or create unnecessary functions(The most bothering part is to think of good names for these unnecessary functions)</p>
  <p>I think the feature should be added back at least to lambdas alone. Is there a good alternative?</p>
  <hr />
  <p><strong>Update:</strong> I am using the following helper extending the idea in the answer</p>
  <pre><code>def star(f):
    return lambda args: f(*args)
  
  min(points, key=star(lambda x,y: (x*x + y*y))
  </code></pre>
  <hr />
  <p><strong>Update2:</strong> A cleaner version for <code>star</code></p>
  <pre><code>import functools
  
  def star(f):
      @functools.wraps(f)
      def f_inner(args):
          return f(*args)
      return f_inner
  </code></pre>