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

Method to_set

crates/vm/src/builtins/dict.rs:1170–1175  ·  view source on GitHub ↗
(zelf: PyRef<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1168#[pyclass]
1169trait ViewSetOps: DictView {
1170 fn to_set(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult<PySetInner> {
1171 let len = zelf.dict().__len__();
1172 let zelf: PyObjectRef = Self::iter(zelf, vm)?;
1173 let iter = PyIterIter::new(vm, zelf, Some(len));
1174 PySetInner::from_iter(iter, vm)
1175 }
1176
1177 fn __xor__(zelf: PyRef<Self>, other: ArgIterable, vm: &VirtualMachine) -> PyResult<PySet> {
1178 let zelf = Self::to_set(zelf, vm)?;

Callers

nothing calls this directly

Implementers 1

dict.rscrates/vm/src/builtins/dict.rs

Calls 5

iterFunction · 0.85
newFunction · 0.85
SomeClass · 0.50
__len__Method · 0.45
dictMethod · 0.45

Tested by

no test coverage detected