class_docstr: An ArrayList is a strongly typed list whose type can be anything that can
  be interpreted as a numpy data type.
docstr: x.__setitem__(i, y) <==> x[i]=y
docstr_tok: ["x.__setitem__","(","i",",","y",")","<","==",">","x","[","i","]","=y"]
code: def __setitem__(self, key, data):
      """x.__setitem__(i, y) <==> x[i]=y"""
      if not self._writeable:
          raise AttributeError("List is not writeable")
  
      if isinstance(key, (int, slice)):
          if isinstance(key, int):
              if key < 0:
                  key += len(self)
              if key < 0 or key > len(self):
                  raise IndexError("List assignment index out of range")
              dstart = self._items[key][0]
              dstop = self._items[key][1]
              istart = key
          elif isinstance(key, slice):
              istart, istop, step = key.indices(len(self))
              if istart == istop:
                  return
              if istart > istop:
                  istart, istop = istop, istart
              if istart > len(self) or istop > len(self):
                  raise IndexError("Can only assign iterable")
              dstart = self._items[istart][0]
              if istart == istop:
                  dstop = dstart
              else:
                  dstop = self._items[istop - 1][1]
  
          if hasattr(data, "__len__"):
              if len(data) == dstop - dstart:  # or len(data) == 1:
                  self._data[dstart:dstop] = data
              else:
                  self.__delitem__(key)
                  self.insert(istart, data)
          else:  # we assume len(data) = 1
              if dstop - dstart == 1:
                  self._data[dstart:dstop] = data
              else:
                  self.__delitem__(key)
                  self.insert(istart, data)
  
      elif key is Ellipsis:
          self.data[...] = data
  
      elif isinstance(key, str):
          self._data[key][: self._size] = data
  
      else:
          raise TypeError("List assignment indices must be integers")
  
file_path: vispy/vispy/visuals/collections/array_list.py
imports: import numpy
label_desc: Use image node_id 10 for calling the ArrayList obj's underlying member method code with example usage: obj.__setitem__(key, data) without return types