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

Function get_objects

crates/vm/src/stdlib/gc.rs:161–170  ·  view source on GitHub ↗
(args: GetObjectsArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

159
160 #[pyfunction]
161 fn get_objects(args: GetObjectsArgs, vm: &VirtualMachine) -> PyResult<PyListRef> {
162 let generation_opt = args.generation.flatten();
163 if let Some(g) = generation_opt
164 && !(0..=2).contains(&g)
165 {
166 return Err(vm.new_value_error(format!("generation must be in range(0, 3), not {}", g)));
167 }
168 let objects = gc_state::gc_state().get_objects(generation_opt);
169 Ok(vm.ctx.new_list(objects))
170 }
171
172 /// Return the list of objects directly referred to by any of the arguments.
173 #[pyfunction]

Callers

nothing calls this directly

Calls 6

gc_stateFunction · 0.85
get_objectsMethod · 0.80
new_listMethod · 0.80
ErrClass · 0.50
flattenMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected