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

Method pop_item

crates/vm/src/builtins/dict.rs:734–746  ·  view source on GitHub ↗
(
        &self,
        key: &K,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

732 }
733
734 pub fn pop_item<K: DictKey + ?Sized>(
735 &self,
736 key: &K,
737 vm: &VirtualMachine,
738 ) -> PyResult<Option<PyObjectRef>> {
739 if self.exact_dict(vm) {
740 self.entries.remove_if_exists(vm, key)
741 } else {
742 let value = self.as_object().get_item(key, vm)?;
743 self.as_object().del_item(key, vm)?;
744 Ok(Some(value))
745 }
746 }
747
748 pub fn get_chain<K: DictKey + ?Sized>(
749 &self,

Callers

nothing calls this directly

Calls 6

exact_dictMethod · 0.80
remove_if_existsMethod · 0.80
SomeClass · 0.50
get_itemMethod · 0.45
as_objectMethod · 0.45
del_itemMethod · 0.45

Tested by

no test coverage detected