We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d273516 commit 2a2fca0Copy full SHA for 2a2fca0
src/searcher.rs
@@ -65,13 +65,16 @@ impl SearchResult {
65
}
66
67
68
- fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult<bool> {
+ fn __richcmp__(
69
+ &self,
70
+ other: &Self,
71
+ op: CompareOp,
72
+ py: Python<'_>,
73
+ ) -> PyObject {
74
match op {
- CompareOp::Eq => Ok(self == other),
- CompareOp::Ne => Ok(self != other),
- _ => Err(PyNotImplementedError::new_err(format!(
- "{op:?} op is not supported"
- ))),
75
+ CompareOp::Eq => (self == other).into_py(py),
76
+ CompareOp::Ne => (self != other).into_py(py),
77
+ _ => py.NotImplemented(),
78
79
80
0 commit comments