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

Method get_namespace

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

Source from the content-addressed store, hash-verified

327
328 #[pymethod]
329 fn get_namespace(&self, vm: &VirtualMachine) -> PyResult {
330 if self.namespaces.len() != 1 {
331 return Err(vm.new_value_error("namespace is bound to multiple namespaces"));
332 }
333 Ok(to_py_symbol_table(self.namespaces.first().unwrap().clone())
334 .into_ref(&vm.ctx)
335 .into())
336 }
337 }
338}

Callers

nothing calls this directly

Calls 7

to_py_symbol_tableFunction · 0.85
ErrClass · 0.50
lenMethod · 0.45
into_refMethod · 0.45
cloneMethod · 0.45
unwrapMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected