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

Method cmp

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

Source from the content-addressed store, hash-verified

545
546impl Comparable for PyTuple {
547 fn cmp(
548 zelf: &Py<Self>,
549 other: &PyObject,
550 op: PyComparisonOp,
551 vm: &VirtualMachine,
552 ) -> PyResult<PyComparisonValue> {
553 if let Some(res) = op.identical_optimization(zelf, other) {
554 return Ok(res.into());
555 }
556 let other = class_or_notimplemented!(Self, other);
557 zelf.iter()
558 .richcompare(other.iter(), op, vm)
559 .map(PyComparisonValue::Implemented)
560 }
561}
562
563impl Iterable for PyTuple {

Callers

nothing calls this directly

Calls 4

richcompareMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected