Thanks @luk-f-a.
As queried: Dynamic, heterogeneous dictionaries with tuple keys and non-constant tuple slicing - #5 by ulupo
is the idea used in the overloaded
setitemmethod ofTupleKeyDictsafe to collisions?
I suggested hashing the tuple here How to use a sequence as dict key? - #4 by stuartarchibald, what amounts to a suitable hash depends on the use case!
The example I wrote is relying on the hashing implementation for tuples-of-ints. This has been strengthed a lot in recent versions of Python, Numba replicates the algorithm. It’s not guaranteed collision free but in practice may be ok for a given use case. Practically, the values are often bounded and so it may be feasible to just test them all!?