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

Method hash

crates/vm/src/builtins/float.rs:451–453  ·  view source on GitHub ↗
(zelf: &Py<Self>, _vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

449impl Hashable for PyFloat {
450 #[inline]
451 fn hash(zelf: &Py<Self>, _vm: &VirtualMachine) -> PyResult<hash::PyHash> {
452 Ok(hash::hash_float(zelf.to_f64()).unwrap_or_else(|| hash::hash_object_id(zelf.get_id())))
453 }
454}
455
456impl AsNumber for PyFloat {

Callers

nothing calls this directly

Calls 4

hash_floatFunction · 0.85
hash_object_idFunction · 0.85
to_f64Method · 0.80
get_idMethod · 0.45

Tested by

no test coverage detected