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

Method slot_richcompare

crates/vm/src/types/slot.rs:1812–1825  ·  view source on GitHub ↗
(
        zelf: &PyObject,
        other: &PyObject,
        op: PyComparisonOp,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

1810 #[inline]
1811 #[pyslot]
1812 fn slot_richcompare(
1813 zelf: &PyObject,
1814 other: &PyObject,
1815 op: PyComparisonOp,
1816 vm: &VirtualMachine,
1817 ) -> PyResult<Either<PyObjectRef, PyComparisonValue>> {
1818 let zelf = zelf.downcast_ref().ok_or_else(|| {
1819 vm.new_type_error(format!(
1820 "unexpected payload for {}",
1821 op.method_name(&vm.ctx).as_str()
1822 ))
1823 })?;
1824 Self::cmp(zelf, other, op, vm).map(Either::B)
1825 }
1826
1827 fn cmp(
1828 zelf: &Py<Self>,

Callers

nothing calls this directly

Implementers 15

openssl.rscrates/stdlib/src/openssl.rs
array.rscrates/stdlib/src/array.rs
_sqlite3.rscrates/stdlib/src/_sqlite3.rs
ssl.rscrates/stdlib/src/ssl.rs
cert.rscrates/stdlib/src/openssl/cert.rs
_sre.rscrates/vm/src/stdlib/_sre.rs
_collections.rscrates/vm/src/stdlib/_collections.rs
typevar.rscrates/vm/src/stdlib/typevar.rs
str.rscrates/vm/src/builtins/str.rs
dict.rscrates/vm/src/builtins/dict.rs
int.rscrates/vm/src/builtins/int.rs
union.rscrates/vm/src/builtins/union.rs

Calls 4

cmpFunction · 0.85
ok_or_elseMethod · 0.80
downcast_refMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected