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

Method add_frozen_modules

crates/vm/src/vm/interpreter.rs:246–252  ·  view source on GitHub ↗

Add frozen modules to the interpreter. Frozen modules are Python modules compiled into the binary. This method accepts any iterator of (name, FrozenModule) pairs. # Example ``` use rustpython_vm::Interpreter; let interp = Interpreter::builder(Default::default()) // In practice: .add_frozen_modules(rustpython_pylib::FROZEN_STDLIB) .build(); ```

(mut self, frozen: I)

Source from the content-addressed store, hash-verified

244 /// .build();
245 /// ```
246 pub fn add_frozen_modules<I>(mut self, frozen: I) -> Self
247 where
248 I: IntoIterator<Item = (&'static str, FrozenModule)>,
249 {
250 self.frozen_modules.extend(frozen);
251 self
252 }
253
254 /// Build the interpreter.
255 ///

Callers 4

interpreter_with_vmFunction · 0.80
init_stdlibMethod · 0.80
newMethod · 0.80
test_nested_frozenFunction · 0.80

Calls 1

extendMethod · 0.45

Tested by 1

test_nested_frozenFunction · 0.64