def __delitem__(self, idx):
if isinstance(idx, slice):<EOL><INDENT>start, stop, step = idx.indices(self._len)<EOL>if step == <NUM_LIT:1> and start < stop:<EOL><INDENT>if start == <NUM_LIT:0> and stop == self._len:<EOL><INDENT>return self._clear()<EOL><DEDENT>elif self._len <= <NUM_LIT:8> * (stop - start):<EOL><INDENT>values = self._getitem(slice(None, start))<EOL>if stop < self._len:<EOL><INDENT>values += self._getitem(slice(stop, None))<EOL><DEDENT>self._clear()<EOL>return self._update(values)<EOL><DEDENT><DEDENT>indices = range(start, stop, step)<EOL>if step > <NUM_LIT:0>:<EOL><INDENT>indices = reversed(indices)<EOL><DEDENT>_pos, _delete = self._pos, self._delete<EOL>for index in indices:<EOL><INDENT>pos, idx = _pos(index)<EOL>_delete(pos, idx)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>pos, idx = self._pos(idx)<EOL>self._delete(pos, idx)<EOL><DEDENT>
Remove the element at *idx*. Supports slicing.