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

Method delete_if

crates/vm/src/dict_inner.rs:453–459  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine, key: &K, pred: F)

Source from the content-addressed store, hash-verified

451 }
452
453 pub fn delete_if<K, F>(&self, vm: &VirtualMachine, key: &K, pred: F) -> PyResult<bool>
454 where
455 K: DictKey + ?Sized,
456 F: Fn(&T) -> PyResult<bool>,
457 {
458 self.remove_if(vm, key, pred).map(|opt| opt.is_some())
459 }
460
461 pub fn remove_if_exists<K>(&self, vm: &VirtualMachine, key: &K) -> PyResult<Option<T>>
462 where

Callers 1

_remove_dead_weakrefFunction · 0.80

Calls 2

remove_ifMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected