No conversion from set(int64) to reflected set(int64)

I’m trying to get a recursive function to work. It takes an array and a set:

@njit
def lhaf(A, d: set) -> float:
    if not d:
        return 1.0
    k = d.pop()
    result = 0.0
    for i in d.intersection(set(np.nonzero(A[k])[0])):
        result += A[i, k] * lhaf(A, d.difference({i}))
    return result

When I try it I get a deprecation warning and a TypeError:

No conversion from set(int64) to reflected set(int64)

But the stack trace points to internal numba code, not my code (numba/cpython/setobj.py", line 1363). How can I solve this?

hi @ziofil , could you also include the code necessary to call lhaf?

thanks