(
zelf: &Py<Self>,
other: &PyObject,
op: PyComparisonOp,
vm: &VirtualMachine,
)
| 1073 | |
| 1074 | impl Comparable for PyMemoryView { |
| 1075 | fn cmp( |
| 1076 | zelf: &Py<Self>, |
| 1077 | other: &PyObject, |
| 1078 | op: PyComparisonOp, |
| 1079 | vm: &VirtualMachine, |
| 1080 | ) -> PyResult<PyComparisonValue> { |
| 1081 | match op { |
| 1082 | PyComparisonOp::Ne => { |
| 1083 | Self::eq(zelf, other, vm).map(|x| PyComparisonValue::Implemented(!x)) |
| 1084 | } |
| 1085 | PyComparisonOp::Eq => Self::eq(zelf, other, vm).map(PyComparisonValue::Implemented), |
| 1086 | _ => Err(vm.new_type_error(format!( |
| 1087 | "'{}' not supported between instances of '{}' and '{}'", |
| 1088 | op.operator_token(), |
| 1089 | zelf.class().name(), |
| 1090 | other.class().name() |
| 1091 | ))), |
| 1092 | } |
| 1093 | } |
| 1094 | } |
| 1095 | |
| 1096 | impl Hashable for PyMemoryView { |
no test coverage detected