| 165 | |
| 166 | impl Comparable for PyInterpolation { |
| 167 | fn cmp( |
| 168 | zelf: &Py<Self>, |
| 169 | other: &PyObject, |
| 170 | op: PyComparisonOp, |
| 171 | vm: &VirtualMachine, |
| 172 | ) -> PyResult<PyComparisonValue> { |
| 173 | op.eq_only(|| { |
| 174 | let other = class_or_notimplemented!(Self, other); |
| 175 | |
| 176 | let eq = vm.bool_eq(&zelf.value, &other.value)? |
| 177 | && vm.bool_eq(zelf.expression.as_object(), other.expression.as_object())? |
| 178 | && vm.bool_eq(&zelf.conversion, &other.conversion)? |
| 179 | && vm.bool_eq(zelf.format_spec.as_object(), other.format_spec.as_object())?; |
| 180 | |
| 181 | Ok(eq.into()) |
| 182 | }) |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | impl Hashable for PyInterpolation { |