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

Method children

crates/vm/src/stdlib/_symtable.rs:172–188  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

170
171 #[pygetset]
172 fn children(&self, vm: &VirtualMachine) -> PyResult<Vec<PyObjectRef>> {
173 let children = self
174 .symtable
175 .sub_tables
176 .iter()
177 .flat_map(|t| {
178 if t.comp_inlined {
179 // Flatten: replace inlined comprehension tables with their children
180 t.sub_tables.iter().collect::<Vec<_>>()
181 } else {
182 vec![t]
183 }
184 })
185 .map(|t| to_py_symbol_table(t.clone()).into_pyobject(vm))
186 .collect();
187 Ok(children)
188 }
189
190 #[pygetset]
191 fn id(&self) -> usize {

Callers

nothing calls this directly

Calls 6

to_py_symbol_tableFunction · 0.85
collectMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45
into_pyobjectMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected