(
zelf: &Py<Self>,
other: &PyObject,
op: PyComparisonOp,
vm: &VirtualMachine,
)
| 1206 | } |
| 1207 | |
| 1208 | fn cmp( |
| 1209 | zelf: &Py<Self>, |
| 1210 | other: &PyObject, |
| 1211 | op: PyComparisonOp, |
| 1212 | vm: &VirtualMachine, |
| 1213 | ) -> PyResult<PyComparisonValue> { |
| 1214 | match_class!(match other { |
| 1215 | ref dictview @ Self => { |
| 1216 | return zelf.dict().inner_cmp( |
| 1217 | dictview.dict(), |
| 1218 | op, |
| 1219 | !zelf.class().is(vm.ctx.types.dict_keys_type), |
| 1220 | vm, |
| 1221 | ); |
| 1222 | } |
| 1223 | ref _set @ PySet => { |
| 1224 | let inner = Self::to_set(zelf.to_owned(), vm)?; |
| 1225 | let zelf_set = PySet { inner }.into_pyobject(vm); |
| 1226 | return PySet::cmp(zelf_set.downcast_ref().unwrap(), other, op, vm); |
| 1227 | } |
| 1228 | ref _dictitems @ PyDictItems => {} |
| 1229 | ref _dictkeys @ PyDictKeys => {} |
| 1230 | _ => { |
| 1231 | return Ok(NotImplemented); |
| 1232 | } |
| 1233 | }); |
| 1234 | let lhs: Vec<PyObjectRef> = zelf.as_object().to_owned().try_into_value(vm)?; |
| 1235 | let rhs: Vec<PyObjectRef> = other.to_owned().try_into_value(vm)?; |
| 1236 | lhs.iter() |
| 1237 | .richcompare(rhs.iter(), op, vm) |
| 1238 | .map(PyComparisonValue::Implemented) |
| 1239 | } |
| 1240 | |
| 1241 | #[pymethod] |
| 1242 | fn isdisjoint(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<bool> { |
nothing calls this directly
no test coverage detected