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

Function make_union

crates/vm/src/builtins/union.rs:364–370  ·  view source on GitHub ↗
(args: &Py<PyTuple>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

362}
363
364pub fn make_union(args: &Py<PyTuple>, vm: &VirtualMachine) -> PyResult {
365 let result = dedup_and_flatten_args(args, vm)?;
366 Ok(match result.args.len() {
367 1 => result.args[0].to_owned(),
368 _ => PyUnion::from_components(result, vm)?.to_pyobject(vm),
369 })
370}
371
372impl PyUnion {
373 fn getitem(zelf: PyRef<Self>, needle: PyObjectRef, vm: &VirtualMachine) -> PyResult {

Callers 5

as_numberMethod · 0.85
populate_field_typesFunction · 0.85
__class_getitem__Method · 0.85
or_opFunction · 0.85
getitemMethod · 0.85

Calls 4

dedup_and_flatten_argsFunction · 0.85
lenMethod · 0.45
to_ownedMethod · 0.45
to_pyobjectMethod · 0.45

Tested by

no test coverage detected