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

Method ternary_iop

crates/vm/src/vm/vm_ops.rs:384–400  ·  view source on GitHub ↗
(
        &self,
        a: &PyObject,
        b: &PyObject,
        c: &PyObject,
        iop_slot: PyNumberTernaryOp,
        op_slot: PyNumberTernaryOp,
        op_str: &str,
    )

Source from the content-addressed store, hash-verified

382 }
383
384 fn ternary_iop(
385 &self,
386 a: &PyObject,
387 b: &PyObject,
388 c: &PyObject,
389 iop_slot: PyNumberTernaryOp,
390 op_slot: PyNumberTernaryOp,
391 op_str: &str,
392 ) -> PyResult {
393 if let Some(slot) = a.class().slots.as_number.left_ternary_op(iop_slot) {
394 let x = slot(a, b, c, self)?;
395 if !x.is(&self.ctx.not_implemented) {
396 return Ok(x);
397 }
398 }
399 self.ternary_op(a, b, c, op_slot, op_str)
400 }
401
402 binary_func!(_sub, Subtract, "-");
403 binary_func!(_mod, Remainder, "%");

Callers

nothing calls this directly

Calls 4

left_ternary_opMethod · 0.80
isMethod · 0.80
ternary_opMethod · 0.80
classMethod · 0.45

Tested by

no test coverage detected