MCPcopy Index your code
hub / github.com/RustPython/RustPython / __delitem__

Method __delitem__

crates/vm/src/stdlib/_collections.rs:296–301  ·  view source on GitHub ↗
(&self, idx: isize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

294 }
295
296 fn __delitem__(&self, idx: isize, vm: &VirtualMachine) -> PyResult<()> {
297 let mut deque = self.borrow_deque_mut();
298 idx.wrapped_at(deque.len())
299 .and_then(|i| deque.remove(i).map(drop))
300 .ok_or_else(|| vm.new_index_error("deque index out of range"))
301 }
302
303 fn __contains__(&self, needle: PyObjectRef, vm: &VirtualMachine) -> PyResult<bool> {
304 self._contains(&needle, vm)

Callers

nothing calls this directly

Calls 6

borrow_deque_mutMethod · 0.80
ok_or_elseMethod · 0.80
wrapped_atMethod · 0.80
lenMethod · 0.45
mapMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected