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

Method delete_if_exists

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

Source from the content-addressed store, hash-verified

444 }
445
446 pub fn delete_if_exists<K>(&self, vm: &VirtualMachine, key: &K) -> PyResult<bool>
447 where
448 K: DictKey + ?Sized,
449 {
450 self.remove_if_exists(vm, key).map(|opt| opt.is_some())
451 }
452
453 pub fn delete_if<K, F>(&self, vm: &VirtualMachine, key: &K, pred: F) -> PyResult<bool>
454 where

Callers 3

differenceMethod · 0.80
discardMethod · 0.80
difference_updateMethod · 0.80

Calls 2

remove_if_existsMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected