Skip to content
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

Document how to use tuples with numba.typed.List and numba.typed.Dict #4521

Open
alanhdu opened this issue Sep 5, 2019 · 1 comment
Open

Comments

@alanhdu
Copy link
Contributor

alanhdu commented Sep 5, 2019

Feature request

Right now, the docs for numba.typed.Dict say that:

Acceptable key/value types include but are not limited to: unicode strings, arrays, scalars, tuples.

But there are no examples of how to actually use it with tuples! I couldn't find how to construct a numba "tuple" class -- i had hoped that:

numba.typed.Dict.empty(
    key_type=(numba.types.unicode_type, numba.types.int32), 
    value_type=numba.types.float32, 
)

would work, but that fails at runtime (constructing the dictionary works fine, but actually inserting anything into it fails).

I ended up just using numba.typeof instead, but it'd be nice to have an example in the documentation!

(Thanks for this great feature BTW! This massively expands the places where I can use Numba!)

@stuartarchibald
Copy link
Contributor

xref #3349 and #4497

@esc esc added this to To do in numba.typed.List Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants