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

Method union

crates/vm/src/builtins/set.rs:246–253  ·  view source on GitHub ↗
(&self, other: ArgIterable, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

244 }
245
246 pub(super) fn union(&self, other: ArgIterable, vm: &VirtualMachine) -> PyResult<Self> {
247 let set = self.clone();
248 for item in other.iter(vm)? {
249 set.add(item?, vm)?;
250 }
251
252 Ok(set)
253 }
254
255 pub(super) fn intersection(&self, other: ArgIterable, vm: &VirtualMachine) -> PyResult<Self> {
256 let set = Self::default();

Callers 2

__or__Method · 0.45
set_inner_number_orFunction · 0.45

Calls 5

fold_opMethod · 0.80
cloneMethod · 0.45
iterMethod · 0.45
addMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected