You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In one function, the jit complains about a variable as having an undeterminable type, even though it has been explicitly typed: Type of variable 'artp.2' cannot be determined, operation: call $1078load_global.2($binop_add1104.10, func=$1078load_global.2, args=[Var($binop_add1104.10, primes2025a.py:240)], kws=(), vararg=None, varkwarg=None, target=None), location: /home/dakra/./primes2025a.py (240)
where the code looks like:
fromnumbaimportnjitfromnumbaimportjit@jitdefsieve12(upToNumm: int=100000000, pnprimorial:int=3) ->list[int]:
# early in the function similar to:C0:int=0modprimorialdo:list[int]=[1,5]
lmodprimorialdo:int=len(modprimorialdo)
ddocol:int=C0fdorowcol:list[int]=[C0,C0]
artp:int=C0# and later: # there are assignment statements for useful values for these variables, and then:artp:int=int(ddocol+fdorowcol[C0]*lmodprimorialdo))
The full error report is :
Traceback (most recent call last):
File "/home/dakra/./primes2025a.py", line 810, in <module>
print("sieve12",n,pr,len(primesl:=sieve12(n,pr)), primesl[:10], primesl[-10:])
^^^^^^^^^^^^^
File "/home/dakra/.local/lib/python3.12/site-packages/numba/core/dispatcher.py", line 423, in _compile_for_args
error_rewrite(e, 'typing')
File "/home/dakra/.local/lib/python3.12/site-packages/numba/core/dispatcher.py", line 364, in error_rewrite
raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Type of variable 'artp.2' cannot be determined, operation: call $1078load_global.2($binop_add1104.10, func=$1078load_global.2, args=[Var($binop_add1104.10, primes2025a.py:240)], kws=(), vararg=None, varkwarg=None, target=None), location: /home/dakra/./primes2025a.py (240)
File "primes2025a.py", line 240:
def sieve12(upToNumm: int=100000000, pnprimorial:int=3)->list[int]:
<source elided>
artp:int=int(ddocol+fdorowcol[C0]*lmodprimorialdo)
^
In another case, the jit processing complained about one of the parameters.
What does it take to get the jit to recognize the explicit type specifications?
CPython versions tested on:
3.12
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered:
Hi!
This repository is a CPython bug tracker, and numba is not part of CPython.
Please report it to the Numba bug tracker: https://github.com/numba/numba/issues
Bug report
Bug description:
I have several functions that work fine with jit and njit. All variables are explicitly typed, such as
In one function, the jit complains about a variable as having an undeterminable type, even though it has been explicitly typed:
Type of variable 'artp.2' cannot be determined, operation: call $1078load_global.2($binop_add1104.10, func=$1078load_global.2, args=[Var($binop_add1104.10, primes2025a.py:240)], kws=(), vararg=None, varkwarg=None, target=None), location: /home/dakra/./primes2025a.py (240)
where the code looks like:
The full error report is :
In another case, the jit processing complained about one of the parameters.
What does it take to get the jit to recognize the explicit type specifications?
CPython versions tested on:
3.12
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: