title: Tuple unpacking while indexing
body: <p>This works:</p>
  
  <pre><code>x = ['foo', 'bar']
  y = [*x]
  print(y)  # prints ['foo', 'bar']
  </code></pre>
  
  <p>but this doesn't:</p>
  
  <pre><code>x = ['foo', 'bar']
  y[*x]  # raises SyntaxError (not NameError!)
  </code></pre>
  
  <p>How can I unpack tuples while indexing?</p>
  
  <p>Here are two examples where I'd like to use this approach, but I'm more interested in understanding why <code>*</code>-unpacking seems not to be supported in indexing in general.</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  
  def lookup(a: np.ndarray, coordinates: tuple) -&gt; float:
      return a[*coordinates]
  
  a1 = np.zeros((2, 2))
  print(lookup(a1, (0, 1))  # Should print 0
  
  a2 = np.zeros(2, 2, 2))
  print(lookup(a2, (0, 0, 1))  # Should print 0
  </code></pre>
  
  <p>or</p>
  
  <pre class="lang-py prettyprint-override"><code>from typing import Tuple
  
  NUM_DIMENSIONS = 2  # Might change at a later point in time
  
  # Should be equivalent to Tuple[float ,float]
  Result = Tuple[*([float] * NUM_DIMENSIONS)]
  
  def get() -&gt; Result:
      ...
  </code></pre>