MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / do_compare

Method do_compare

src/objectprotocol.rs:105–113  ·  view source on GitHub ↗
(
            py: Python,
            a: *mut ffi::PyObject,
            b: *mut ffi::PyObject,
        )

Source from the content-addressed store, hash-verified

103 {
104 #[cfg(feature = "python27-sys")]
105 unsafe fn do_compare(
106 py: Python,
107 a: *mut ffi::PyObject,
108 b: *mut ffi::PyObject,
109 ) -> PyResult<Ordering> {
110 let mut result = -1;
111 err::error_on_minusone(py, ffi::PyObject_Cmp(a, b, &mut result))?;
112 Ok(result.cmp(&0))
113 }
114
115 #[cfg(feature = "python3-sys")]
116 unsafe fn do_compare(

Callers

nothing calls this directly

Calls 2

error_on_minusoneFunction · 0.85
cmpMethod · 0.80

Tested by

no test coverage detected