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

Function reduce_set

crates/vm/src/builtins/set.rs:511–522  ·  view source on GitHub ↗
(
    zelf: &PyObject,
    vm: &VirtualMachine,
)

Source from the content-addressed store, hash-verified

509}
510
511fn reduce_set(
512 zelf: &PyObject,
513 vm: &VirtualMachine,
514) -> PyResult<(PyTypeRef, PyTupleRef, Option<PyDictRef>)> {
515 Ok((
516 zelf.class().to_owned(),
517 vm.new_tuple((extract_set(zelf)
518 .unwrap_or(&PySetInner::default())
519 .elements(),)),
520 zelf.dict(),
521 ))
522}
523
524#[pyclass(
525 with(

Callers 1

__reduce__Method · 0.85

Calls 6

extract_setFunction · 0.85
to_ownedMethod · 0.45
classMethod · 0.45
new_tupleMethod · 0.45
elementsMethod · 0.45
dictMethod · 0.45

Tested by

no test coverage detected