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

Function module_exec

crates/stdlib/src/unicodedata.rs:53–78  ·  view source on GitHub ↗
(vm: &VirtualMachine, module: &Py<PyModule>)

Source from the content-addressed store, hash-verified

51 use unicode_bidi_mirroring::is_mirroring;
52
53 pub(crate) fn module_exec(vm: &VirtualMachine, module: &Py<PyModule>) -> PyResult<()> {
54 __module_exec(vm, module);
55
56 // Add UCD methods as module-level functions
57 let ucd: PyObjectRef = Ucd::new(UNICODE_VERSION).into_ref(&vm.ctx).into();
58
59 for attr in [
60 "category",
61 "lookup",
62 "name",
63 "bidirectional",
64 "combining",
65 "decimal",
66 "decomposition",
67 "digit",
68 "east_asian_width",
69 "is_normalized",
70 "mirrored",
71 "normalize",
72 "numeric",
73 ] {
74 module.set_attr(attr, ucd.get_attr(attr, vm)?, vm)?;
75 }
76
77 Ok(())
78 }
79
80 #[pyattr]
81 #[pyclass(name = "UCD")]

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
into_refMethod · 0.45
set_attrMethod · 0.45
get_attrMethod · 0.45

Tested by

no test coverage detected