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

Function has_union_operands

crates/vm/src/builtins/union.rs:217–220  ·  view source on GitHub ↗
(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

215}
216
217fn has_union_operands(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine) -> bool {
218 let union_type = vm.ctx.types.union_type;
219 a.class().is(union_type) || b.class().is(union_type)
220}
221
222pub fn or_op(zelf: PyObjectRef, other: PyObjectRef, vm: &VirtualMachine) -> PyResult {
223 if !has_union_operands(zelf.clone(), other.clone(), vm)

Callers 1

or_opFunction · 0.85

Calls 2

isMethod · 0.80
classMethod · 0.45

Tested by

no test coverage detected