(zelf: &Py<Self>, _vm: &VirtualMachine)
| 432 | impl Hashable for PyComplex { |
| 433 | #[inline] |
| 434 | fn hash(zelf: &Py<Self>, _vm: &VirtualMachine) -> PyResult<hash::PyHash> { |
| 435 | let value = zelf.value; |
| 436 | |
| 437 | let re_hash = |
| 438 | hash::hash_float(value.re).unwrap_or_else(|| hash::hash_object_id(zelf.get_id())); |
| 439 | |
| 440 | let im_hash = |
| 441 | hash::hash_float(value.im).unwrap_or_else(|| hash::hash_object_id(zelf.get_id())); |
| 442 | |
| 443 | let Wrapping(ret) = Wrapping(re_hash) + Wrapping(im_hash) * Wrapping(hash::IMAG); |
| 444 | Ok(hash::fix_sentinel(ret)) |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | impl AsNumber for PyComplex { |
nothing calls this directly
no test coverage detected