| 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")] |