def __setslice__(self, i, j, value): ndarray.__setslice__(self, i, j, value) if j == maxint: j = len(self) if hasattr(value, "__getitem__"): # setting to a list for index in range(i, j): setattr(self._list[index], self._attr, value[index]) else: for index in range(i, j): setattr(self._list[index], self._attr, value)
def __setslice__(self, i, j, value): """Set slice equal to given value(s)""" ndarray.__setslice__(self, i, j, value)
def _extend(self, other): old_size = len(self) new_size = old_size + len(other) self.resize(new_size, refcheck=False) ndarray.__setslice__(self, old_size, new_size, other)