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

Method binary_iop1

crates/vm/src/vm/vm_ops.rs:261–275  ·  view source on GitHub ↗

Binary in-place operators The in-place operators are defined to fall back to the 'normal', non in-place operations, if the in-place methods are not in place. - If the left hand object has the appropriate struct members, and they are filled, call the appropriate function and return the result. No coercion is done on the arguments; the left-hand object is the one the operation is performed on, an

(
        &self,
        a: &PyObject,
        b: &PyObject,
        iop_slot: PyNumberBinaryOp,
        op_slot: PyNumberBinaryOp,
    )

Source from the content-addressed store, hash-verified

259 /// - Otherwise, in-place modification is not supported. Handle it exactly as
260 /// a non in-place operation of the same kind.
261 fn binary_iop1(
262 &self,
263 a: &PyObject,
264 b: &PyObject,
265 iop_slot: PyNumberBinaryOp,
266 op_slot: PyNumberBinaryOp,
267 ) -> PyResult {
268 if let Some(slot) = a.class().slots.as_number.left_binary_op(iop_slot) {
269 let x = slot(a, b, self)?;
270 if !x.is(&self.ctx.not_implemented) {
271 return Ok(x);
272 }
273 }
274 self.binary_op1(a, b, op_slot)
275 }
276
277 fn binary_iop(
278 &self,

Callers 3

binary_iopMethod · 0.80
_iaddMethod · 0.80
_imulMethod · 0.80

Calls 4

left_binary_opMethod · 0.80
isMethod · 0.80
binary_op1Method · 0.80
classMethod · 0.45

Tested by

no test coverage detected