MCPcopy Index your code
hub / github.com/RustPython/RustPython / cmp

Method cmp

crates/vm/src/builtins/interpolation.rs:167–183  ·  view source on GitHub ↗
(
        zelf: &Py<Self>,
        other: &PyObject,
        op: PyComparisonOp,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

165
166impl 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
186impl Hashable for PyInterpolation {

Callers

nothing calls this directly

Calls 3

eq_onlyMethod · 0.80
bool_eqMethod · 0.80
as_objectMethod · 0.45

Tested by

no test coverage detected