def unbox_slice(typ, obj, c):
    """
    Convert object *obj* to a native slice structure.
    """
    from numba.cpython import slicing
    ok, start, stop, step = c.pyapi.slice_as_ints(obj)
    sli = c.context.make_helper(c.builder, typ)
    sli.start = start
    sli.stop = stop
    sli.step = step
    return NativeValue(sli._getvalue(), is_error=c.builder.not_(ok))

    Convert object *obj* to a native slice structure.
    
numba/core/new_boxing.py