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

Method iter

crates/stdlib/src/contextvars.rs:282–287  ·  view source on GitHub ↗
(zelf: PyRef<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

280
281 impl Iterable for PyContext {
282 fn iter(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult {
283 let vars = zelf.borrow_vars();
284 let keys: Vec<PyObjectRef> = vars.keys().map(|k| k.clone().into()).collect();
285 let list = vm.ctx.new_list(keys);
286 <PyList as Iterable>::iter(list, vm)
287 }
288 }
289
290 #[pyattr]

Callers 1

itemsMethod · 0.45

Calls 7

iterFunction · 0.85
borrow_varsMethod · 0.80
collectMethod · 0.80
new_listMethod · 0.80
mapMethod · 0.45
keysMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected