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

Method import_from

crates/vm/src/vm/mod.rs:1790–1798  ·  view source on GitHub ↗
(
        &self,
        module_name: impl AsPyStr<'a>,
        from_list: &Py<PyTuple<PyStrRef>>,
        level: usize,
    )

Source from the content-addressed store, hash-verified

1788 /// Roughly equivalent to `from module_name import item1, item2` or `from top.submodule import item1, item2`
1789 #[inline]
1790 pub fn import_from<'a>(
1791 &self,
1792 module_name: impl AsPyStr<'a>,
1793 from_list: &Py<PyTuple<PyStrRef>>,
1794 level: usize,
1795 ) -> PyResult {
1796 let module_name = module_name.as_pystr(&self.ctx);
1797 self.import_inner(module_name, from_list, level)
1798 }
1799
1800 fn import_inner(
1801 &self,

Callers

nothing calls this directly

Calls 2

as_pystrMethod · 0.80
import_innerMethod · 0.80

Tested by

no test coverage detected