-
I must be stupid, but I don't see how I can set an integer key on an |
Beta Was this translation helpful? Give feedback.
Answered by
wjakob
Oct 20, 2022
Replies: 1 comment
-
Integer indexing is internally wired up to the sequence protocol, which dictionaries do not support. As of commit 93a653c, there is a workaround that you can use: res[nb::int_(value)] = "a"; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wjakob
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Integer indexing is internally wired up to the sequence protocol, which dictionaries do not support. As of commit 93a653c, there is a workaround that you can use:
res[nb::int_(value)] = "a";