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

Method contains

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

Source from the content-addressed store, hash-verified

325 }
326
327 pub fn contains<K: DictKey + ?Sized>(&self, vm: &VirtualMachine, key: &K) -> PyResult<bool> {
328 let key_hash = key.key_hash(vm)?;
329 let (entry, _) = self.lookup(vm, key, key_hash, None)?;
330 Ok(entry.index().is_some())
331 }
332
333 /// Retrieve a key
334 #[cfg_attr(feature = "flame-it", flame("Dict"))]

Callers 15

mainFunction · 0.45
runFunction · 0.45
ensure_no_nulMethod · 0.45
enterMethod · 0.45
parse_groupingFunction · 0.45
get_awaitable_iterFunction · 0.45
py_newMethod · 0.45
slot_newMethod · 0.45
slot_initMethod · 0.45
is_exception_from_origFunction · 0.45
split_by_leaf_idsFunction · 0.45

Calls 3

key_hashMethod · 0.80
lookupMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected