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

Method init

crates/vm/src/builtins/module.rs:424–433  ·  view source on GitHub ↗
(zelf: PyRef<Self>, args: Self::Args, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

422 type Args = ModuleInitArgs;
423
424 fn init(zelf: PyRef<Self>, args: Self::Args, vm: &VirtualMachine) -> PyResult<()> {
425 debug_assert!(
426 zelf.class()
427 .slots
428 .flags
429 .has_feature(crate::types::PyTypeFlags::HAS_DICT)
430 );
431 zelf.init_dict(vm.ctx.intern_str(args.name.as_wtf8()), args.doc, vm);
432 Ok(())
433 }
434}
435
436impl GetAttr for PyModule {

Callers

nothing calls this directly

Calls 3

init_dictMethod · 0.80
intern_strMethod · 0.80
as_wtf8Method · 0.45

Tested by

no test coverage detected