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

Method init_stdlib

src/interpreter.rs:14–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12impl InterpreterBuilderExt for InterpreterBuilder {
13 #[cfg(feature = "stdlib")]
14 fn init_stdlib(self) -> Self {
15 let defs = rustpython_stdlib::stdlib_module_defs(&self.ctx);
16 let builder = self.add_native_modules(&defs);
17
18 #[cfg(feature = "freeze-stdlib")]
19 let builder = builder
20 .add_frozen_modules(rustpython_pylib::FROZEN_STDLIB)
21 .init_hook(set_frozen_stdlib_dir);
22
23 #[cfg(not(feature = "freeze-stdlib"))]
24 let builder = builder.init_hook(setup_dynamic_stdlib);
25
26 builder
27 }
28}
29
30/// Set stdlib_dir for frozen standard library

Callers 4

interpreter_with_configFunction · 0.80
mainFunction · 0.80
interpreterFunction · 0.80
mainFunction · 0.80

Calls 4

stdlib_module_defsFunction · 0.85
add_native_modulesMethod · 0.80
init_hookMethod · 0.80
add_frozen_modulesMethod · 0.80

Tested by

no test coverage detected