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

Method remove_if_exists

crates/vm/src/dict_inner.rs:461–466  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine, key: &K)

Source from the content-addressed store, hash-verified

459 }
460
461 pub fn remove_if_exists<K>(&self, vm: &VirtualMachine, key: &K) -> PyResult<Option<T>>
462 where
463 K: DictKey + ?Sized,
464 {
465 self.remove_if(vm, key, |_| Ok(true))
466 }
467
468 /// pred should be VERY CAREFUL about what it does as it is called while
469 /// the dict's internal mutex is held

Callers 3

deleteMethod · 0.80
delete_if_existsMethod · 0.80
pop_itemMethod · 0.80

Calls 1

remove_ifMethod · 0.80

Tested by

no test coverage detected