Trying to use a set with string values causes AssertionError()

Thanks for the explanation @stuartarchibald. I looked into using a typed Dictionary but unfortunately ran into either errors or performance issues.

The reason I need to populate a set/dict in the numba function is to check for uniqueness in a numpy array (passed as an argument) while doing other calculations. If I pass the numpy array as-is and try to store/query its items in the dict, I run into issues like this: https://github.com/numba/numba/issues/4505

If I convert the numpy array to an ordinary python list, I get a deprecation warning https://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types

If I convert the numpy array into a typed List, that takes a lot of time and makes the njit version slower than the ordinary python version.