I’m trying to specify the types for
objmode to work, but I can’t seem to be able to get it right.
Here’s a short example that summarizes what I need (not the actual code):
@njit def numba_filter(k:int, ints:tuple): with objmode(filtered='???'): filtered = python_filter(k, ints) return np.array(filtered) def python_filter(k, ints): return [(x,x) for x in ints if x < k]
I would normally type-hint
filtered in regular python as
List[Tuple[int]]. How do I do make it work here?