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

Method cmp

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

Source from the content-addressed store, hash-verified

534
535 impl Comparable for PyDeque {
536 fn cmp(
537 zelf: &Py<Self>,
538 other: &PyObject,
539 op: PyComparisonOp,
540 vm: &VirtualMachine,
541 ) -> PyResult<PyComparisonValue> {
542 if let Some(res) = op.identical_optimization(zelf, other) {
543 return Ok(res.into());
544 }
545 let other = class_or_notimplemented!(Self, other);
546 let lhs = zelf.borrow_deque();
547 let rhs = other.borrow_deque();
548 lhs.iter()
549 .richcompare(rhs.iter(), op, vm)
550 .map(PyComparisonValue::Implemented)
551 }
552 }
553
554 impl Iterable for PyDeque {

Callers

nothing calls this directly

Calls 5

borrow_dequeMethod · 0.80
richcompareMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected