0

Im trying to run a code like this,

from numba import njit

@njit 
def fun(x):
    one,*two = x
    print(two)

fun([1,2,3])

But, when I tried to run , it give me the following error mesage:

UnsupportedError: Use of unsupported opcode (UNPACK_EX) found

I need that code structure because I´m using scipy.optimize.minimize that admits only 1 argument, and the lenght of x varies depending on the model

Eimin
  • 1
  • 1
    You should be able to assign the `one` and `two` values without using the unpack feature. That's just a shorthand for basic python actions. – hpaulj Apr 09 '22 at 21:07
  • This is not the only problem: Numba mark reflected lists for deprecation and they will be removed soon. You should not use them. I advise you to use Numpy array instead. Note that reflected lists are inefficient anyway and there is nothing Numba can do about that (the problem comes from CPython) hence the deprecation. – Jérôme Richard Apr 09 '22 at 21:20
  • thanks hpaulj, it works. And thanks for the advise Jérôme Richard. – Eimin Apr 09 '22 at 23:48

0 Answers0