Compares two Python objects. Depending on the value of `compare_op`, equivalent to one of the following Python expressions: CompareOp::Eq: `self == other` CompareOp::Ne: `self != other` CompareOp::Lt: `self < other` CompareOp::Le: `self <= other` CompareOp::Gt: `self > other` CompareOp::Ge: `self >= other`
(
&self,
py: Python,
other: O,
compare_op: crate::CompareOp,
)
| 155 | /// * CompareOp::Gt: `self > other` |
| 156 | /// * CompareOp::Ge: `self >= other` |
| 157 | fn rich_compare<O>( |
| 158 | &self, |
| 159 | py: Python, |
| 160 | other: O, |
| 161 | compare_op: crate::CompareOp, |
| 162 | ) -> PyResult<PyObject> |
| 163 | where |
| 164 | O: ToPyObject, |
| 165 | { |
| 166 | other.with_borrowed_ptr(py, |other| unsafe { |
| 167 | err::result_cast_from_owned_ptr( |
| 168 | py, |
| 169 | ffi::PyObject_RichCompare(self.as_ptr(), other, compare_op as libc::c_int), |
| 170 | ) |
| 171 | }) |
| 172 | } |
| 173 | |
| 174 | /// Compute the string representation of self. |
| 175 | /// This is equivalent to the Python expression 'repr(self)'. |
nothing calls this directly
no test coverage detected