New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: cannot compute fingerprint of empty list #2152
Comments
A work around is to create the list with an initial item of the same type as you are going to add and then throw it away before you return: from numba import jit
@jit
def create_card_deck():
values = "23456789TJQKA"
suites = "CDHS"
Deck = ['x']
for x in values:
for y in suites:
Deck.append(x + y)
return Deck[1:] |
Ok makes sense. Thanks On Tuesday, 18 October 2016, Joshua Adelman notifications@github.com
|
This patch is one way of seemingly fixing the inability to compute the fingerprint of an empty list (or set!), as reported in numba#2152. It seems like empty containers can take part in fast lookup but only if more op codes are added. Whether this is a valid approach, given possible nuances, and the general "adding more opcodes" going against the principle of fast lookup, is to be determined. It should be noted that using '[' for an empty list seemingly works too.
This patch is one way of seemingly fixing the inability to compute the fingerprint of an empty list (or set!), as reported in numba#2152. It seems like empty containers can take part in fast lookup but only if more op codes are added. Whether this is a valid approach, given possible nuances, and the general "adding more opcodes" going against the principle of fast lookup, is to be determined. It should be noted that using '[' for an empty list seemingly works too.
Related comments on what needs to happen to fix this are at the bottom of #2184 |
So, how does the closing of #2184 affect this issue? Is it now intentional to disallow empty lists being passed into nopython jitted functions? |
As of 0.42.0 the original sample works (updates have been made to type inference to help type empty lists). Closing. |
When I use version 0.44.1 numba, the above problem still occurs.
Error message:
|
@Mostro-Complexity reflected lists (what you are using) are in the process of being deprecated, please take a look at their replacement, |
I'm getting the equivalent error for Update: Ah -- https://numba.pydata.org/numba-doc/latest/reference/deprecation.html#expected-replacement Upshot: typed set is at least documented as not yet implemented. |
Yup it's on the wishlist. It is quite the undertaking and will require lot's of code to be written.It will however be reasonably well isolated from the rest of the code base, since the feature will be largely additive. And, in addition there are two existing typed container implementations, |
The text was updated successfully, but these errors were encountered: