(&self, needle: &PyObject, vm: &VirtualMachine)
| 127 | } |
| 128 | |
| 129 | fn _getitem(&self, needle: &PyObject, vm: &VirtualMachine) -> PyResult { |
| 130 | match SequenceIndex::try_from_borrowed_object(vm, needle, "bytearray")? { |
| 131 | SequenceIndex::Int(i) => self |
| 132 | .borrow_buf() |
| 133 | .getitem_by_index(vm, i) |
| 134 | .map(|x| vm.ctx.new_int(x).into()), |
| 135 | SequenceIndex::Slice(slice) => self |
| 136 | .borrow_buf() |
| 137 | .getitem_by_slice(vm, slice) |
| 138 | .map(|x| vm.ctx.new_bytearray(x).into()), |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | pub fn _delitem(&self, needle: &PyObject, vm: &VirtualMachine) -> PyResult<()> { |
| 143 | match SequenceIndex::try_from_borrowed_object(vm, needle, "bytearray")? { |
no test coverage detected