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

Method cmp

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

Source from the content-addressed store, hash-verified

696
697impl Comparable for PyByteArray {
698 fn cmp(
699 zelf: &Py<Self>,
700 other: &PyObject,
701 op: PyComparisonOp,
702 vm: &VirtualMachine,
703 ) -> PyResult<PyComparisonValue> {
704 if let Some(res) = op.identical_optimization(zelf, other) {
705 return Ok(res.into());
706 }
707 Ok(zelf.inner().cmp(other, op, vm))
708 }
709}
710
711static BUFFER_METHODS: BufferMethods = BufferMethods {

Callers

nothing calls this directly

Calls 2

innerMethod · 0.45

Tested by

no test coverage detected