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

Method eq_only

crates/vm/src/types/slot.rs:1856–1865  ·  view source on GitHub ↗
(
        self,
        f: impl FnOnce() -> PyResult<PyComparisonValue>,
    )

Source from the content-addressed store, hash-verified

1854
1855impl PyComparisonOp {
1856 pub fn eq_only(
1857 self,
1858 f: impl FnOnce() -> PyResult<PyComparisonValue>,
1859 ) -> PyResult<PyComparisonValue> {
1860 match self {
1861 Self::Eq => f(),
1862 Self::Ne => f().map(|x| x.map(|eq| !eq)),
1863 _ => Ok(PyComparisonValue::NotImplemented),
1864 }
1865 }
1866
1867 pub fn eval_ord(self, ord: Ordering) -> bool {
1868 match self {

Callers 15

cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80

Calls 2

fFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected