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

Method cmp

crates/vm/src/stdlib/typevar.rs:929–948  ·  view source on GitHub ↗
(
            zelf: &crate::Py<Self>,
            other: &PyObject,
            op: PyComparisonOp,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

927
928 impl Comparable for ParamSpecArgs {
929 fn cmp(
930 zelf: &crate::Py<Self>,
931 other: &PyObject,
932 op: PyComparisonOp,
933 vm: &VirtualMachine,
934 ) -> PyResult<PyComparisonValue> {
935 op.eq_only(|| {
936 if other.class().is(zelf.class())
937 && let Some(other_args) = other.downcast_ref::<ParamSpecArgs>()
938 {
939 let eq = zelf.__origin__.rich_compare_bool(
940 &other_args.__origin__,
941 PyComparisonOp::Eq,
942 vm,
943 )?;
944 return Ok(PyComparisonValue::Implemented(eq));
945 }
946 Ok(PyComparisonValue::NotImplemented)
947 })
948 }
949 }
950
951 #[pyattr]

Callers

nothing calls this directly

Calls 4

eq_onlyMethod · 0.80
isMethod · 0.80
rich_compare_boolMethod · 0.80
classMethod · 0.45

Tested by

no test coverage detected