

@classdef.method('insert', i='int')
@check_frozen()
@jit.look_inside_iff((lambda self, space, i, args_w: jit.isconstant(len(args_w))))
def method_insert(self, space, i, args_w):
    if (not args_w):
        return self
    length = self.length()
    if (i > length):
        self._append_nils(space, (i - length))
        self.items_w.extend(args_w)
        return self
    if (i < 0):
        if (i < ((- length) - 1)):
            raise space.error(space.w_IndexError, ('index %d too small for array; minimum: %d' % ((i + 1), (- length))))
        i += (length + 1)
    assert (i >= 0)
    for w_e in args_w:
        self.items_w.insert(i, w_e)
        i += 1
    return self

dataset/ETHPy150Open topazproject/topaz/topaz/objects/arrayobject.py W_ArrayObject.method_insert/original