Hi,
I added those two lines at the beginning of my script like the homepage example says :
from numba import jit
@jit
I have a global variable in a function.
When I run the script, I get this error message :
NotImplementedError: Use of unknown opcode STORE_GLOBAL at line xx of yyyyyy.py
Can you help ?
Thanks for the report. What you see is I believe correct behaviour. Numba treats globals as compile time constants so the notion of writing to a global (the STORE_GLOBAL opcode) is invalid. This entry in the FAQ might help?
What must I do to make my Python script work ?
Numba doesn't let you modify global variables in compiled functions. You need to use return values, or modify the contents of NumPy arrays.
Thanks, I'll have a look into my code if ever my internship is renewed :)
Most helpful comment
Numba doesn't let you modify global variables in compiled functions. You need to use return values, or modify the contents of NumPy arrays.