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

Method cmp

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

Source from the content-addressed store, hash-verified

123
124impl Comparable for PyNamespace {
125 fn cmp(
126 zelf: &Py<Self>,
127 other: &PyObject,
128 op: PyComparisonOp,
129 vm: &VirtualMachine,
130 ) -> PyResult<PyComparisonValue> {
131 let other = class_or_notimplemented!(Self, other);
132 let (d1, d2) = (
133 zelf.as_object().dict().unwrap(),
134 other.as_object().dict().unwrap(),
135 );
136 PyDict::cmp(&d1, d2.as_object(), op, vm)
137 }
138}
139
140impl Representable for PyNamespace {

Callers

nothing calls this directly

Calls 4

cmpFunction · 0.85
unwrapMethod · 0.45
dictMethod · 0.45
as_objectMethod · 0.45

Tested by

no test coverage detected