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

Method hash

crates/vm/src/builtins/function.rs:1180–1184  ·  view source on GitHub ↗
(zelf: &Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1178
1179impl Hashable for PyBoundMethod {
1180 fn hash(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyHash> {
1181 let self_hash = crate::common::hash::hash_object_id_raw(zelf.object.get_id());
1182 let func_hash = zelf.function.hash(vm)?;
1183 Ok(crate::common::hash::fix_sentinel(self_hash ^ func_hash))
1184 }
1185}
1186
1187impl GetAttr for PyBoundMethod {

Callers

nothing calls this directly

Calls 3

hash_object_id_rawFunction · 0.85
fix_sentinelFunction · 0.85
get_idMethod · 0.45

Tested by

no test coverage detected