def codegen(context, builder, sig, args): [slicetype, lengthtype] = sig.args [sliceobj, length] = args slice = context.make_helper(builder, slicetype, sliceobj) slicing.guard_invalid_slice(context, builder, slicetype, slice) slicing.fix_slice(builder, slice, length) return slice._getvalue()