(&self, needle: &PyObject, vm: &VirtualMachine)
| 160 | } |
| 161 | |
| 162 | fn _getitem(&self, needle: &PyObject, vm: &VirtualMachine) -> PyResult { |
| 163 | match SequenceIndex::try_from_borrowed_object(vm, needle, "byte")? { |
| 164 | SequenceIndex::Int(i) => self |
| 165 | .getitem_by_index(vm, i) |
| 166 | .map(|x| vm.ctx.new_int(x).into()), |
| 167 | SequenceIndex::Slice(slice) => self |
| 168 | .getitem_by_slice(vm, slice) |
| 169 | .map(|x| vm.ctx.new_bytes(x).into()), |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | impl PyRef<PyBytes> { |
no test coverage detected