title: Numba Creating a tuple from a list
body: <p>I have a very simple problem I can't solve.</p>
  <p>I'm using Numba and Cuda.
  I have a list <code>T=[1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0]</code> and I want a tuple with the elements of the list, like this:
  <code>C=(1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0)</code>.</p>
  <p>In Python I would code <code>C=tuple(T)</code>, but I can't with Numba.</p>
  <p>I tried these solutions but none of them work because you can't modify the type of a variable inside a loop with Numba.</p>
  <p><strong>Important</strong> My list has a length which is a multiple of 3 and I use this knowledge for my algorithms.</p>
  <p><strong>Code</strong></p>
  <p>First algorithm, recursively, it works by giving the algorithm L=[(1.0,),(2.0,),(3.0,),(4.0,),(5.0,),...,(9.0,)]</p>
  <pre class="lang-py prettyprint-override"><code>@njit
  def list2tuple(L):
  
      n=len(L)
      if n == 1:
          return L[0]
      else:
          C=[]
          for i in range(0,n-2,3):
              c=L[i]+L[i+1]+L[i+2]
              C.append(c)
          return list2tuple(C)
  </code></pre>
  <p>Problem: It enters an infinite loop and I must stop the kernel. It works in basic Python.</p>
  <p>algorithm 2: it works by giving T=[1.0,2.0,3.0,...,9.0]</p>
  <pre class="lang-py prettyprint-override"><code>@njit
  def list2tuple2(T):
  
      L=[]
      for i in range(len(T)):
          a=(T[i],)
          L.append(a)
      for k in range(len(T)//3-1):
          n=len(L)
          C=[]
          for j in range(0,n-2,3):
              c=L[j]+L[j+1]+L[j+2]
              C.append(c)
          L=C
      return L[0]
  </code></pre>
  <p>Problem  When <code>C=[(1.0,2.0,3.0),(4.0,5.0,6.0),(7.0,8.0,9.0)]</code>, you can't say <code>L=C</code> because <code>L = [(1.0,),(2.0,),(3.0,),....(9.0,)]</code> is List(Unituple(float64x1)) and can't be unified with List(Unituple(float64x3)).</p>
  <p>I can't find a solution for this problem.</p>