You can use explicit declarations or a string declaration:
Tuple with homogeneous types:
@nb.jit(nb.types.UniTuple(nb.float64[:],2)(nb.float64[:]),nopython=True) def f(a) : return a,a @nb.jit('UniTuple(float64[:], 2)(float64[:])',nopython=True) def f(a) : return a,a
Tuple with heterogeneous types:
@nb.jit(nb.types.Tuple((nb.float64[:], nb.float64[:,:]))(nb.float64[:], nb.float64[:,:]),nopython=True) def f(a, b) : return a, b @nb.jit('Tuple((float64[:], float64[:,:]))(float64[:], float64[:,:])',nopython=True) def f(a, b) : return a, b
Source: my own experiments and Numba source code: https://github.com/numba/numba
Of course, the solution suggested by DavidW is a great solution if you don't know the exact type:
@nb.jit(nb.typeof((1.0,1.0))(nb.double),nopython=True) def f(a): return a,a
source share