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

Method number_op

crates/vm/src/builtins/int.rs:723–733  ·  view source on GitHub ↗
(a: &PyObject, b: &PyObject, op: F, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

721 };
722
723 fn number_op<F, R>(a: &PyObject, b: &PyObject, op: F, vm: &VirtualMachine) -> PyResult
724 where
725 F: FnOnce(&BigInt, &BigInt, &VirtualMachine) -> R,
726 R: ToPyResult,
727 {
728 if let (Some(a), Some(b)) = (a.downcast_ref::<Self>(), b.downcast_ref::<Self>()) {
729 op(&a.value, &b.value, vm).to_pyresult(vm)
730 } else {
731 Ok(vm.ctx.not_implemented())
732 }
733 }
734}
735
736#[derive(FromArgs)]

Callers

nothing calls this directly

Calls 2

to_pyresultMethod · 0.45
not_implementedMethod · 0.45

Tested by

no test coverage detected