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

Method repr

crates/vm/src/builtins/module.rs:444–450  ·  view source on GitHub ↗
(zelf: &Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

442impl Representable for PyModule {
443 #[inline]
444 fn repr(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyStrRef> {
445 // Use cached importlib reference (like interp->importlib)
446 let module_repr = vm.importlib.get_attr("_module_repr", vm)?;
447 let repr = module_repr.call((zelf.to_owned(),), vm)?;
448 repr.downcast()
449 .map_err(|_| vm.new_type_error("_module_repr did not return a string"))
450 }
451
452 #[cold]
453 fn repr_str(_zelf: &Py<Self>, _vm: &VirtualMachine) -> PyResult<String> {

Callers

nothing calls this directly

Calls 4

downcastMethod · 0.80
get_attrMethod · 0.45
callMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected