Method
cmp
(
zelf: &Py<Self>,
other: &PyObject,
op: PyComparisonOp,
_vm: &VirtualMachine,
)
Source from the content-addressed store, hash-verified
| 643 | |
| 644 | impl Comparable for PyInt { |
| 645 | fn cmp( |
| 646 | zelf: &Py<Self>, |
| 647 | other: &PyObject, |
| 648 | op: PyComparisonOp, |
| 649 | _vm: &VirtualMachine, |
| 650 | ) -> PyResult<PyComparisonValue> { |
| 651 | let r = other |
| 652 | .downcast_ref::<Self>() |
| 653 | .map(|other| op.eval_ord(zelf.value.cmp(&other.value))); |
| 654 | Ok(PyComparisonValue::from_option(r)) |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | impl Representable for PyInt { |
Callers
nothing calls this directly
Tested by
no test coverage detected