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

Function get_referents

crates/vm/src/stdlib/gc.rs:174–183  ·  view source on GitHub ↗
(args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

172 /// Return the list of objects directly referred to by any of the arguments.
173 #[pyfunction]
174 fn get_referents(args: FuncArgs, vm: &VirtualMachine) -> PyListRef {
175 let mut result = Vec::new();
176
177 for obj in args.args {
178 // Use the gc_get_referents method to get references
179 result.extend(obj.gc_get_referents());
180 }
181
182 vm.ctx.new_list(result)
183 }
184
185 /// Return the list of objects that directly refer to any of the arguments.
186 #[pyfunction]

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
gc_get_referentsMethod · 0.80
new_listMethod · 0.80
extendMethod · 0.45

Tested by

no test coverage detected