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

Method category

crates/stdlib/src/unicodedata.rs:115–124  ·  view source on GitHub ↗
(&self, character: PyStrRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

113 impl Ucd {
114 #[pymethod]
115 fn category(&self, character: PyStrRef, vm: &VirtualMachine) -> PyResult<String> {
116 Ok(self
117 .extract_char(character, vm)?
118 .map_or(GeneralCategory::Unassigned, |c| {
119 c.to_char()
120 .map_or(GeneralCategory::Surrogate, GeneralCategory::of)
121 })
122 .abbr_name()
123 .to_owned())
124 }
125
126 #[pymethod]
127 fn lookup(&self, name: PyStrRef, vm: &VirtualMachine) -> PyResult<String> {

Callers 15

in_table_a1Function · 0.80
in_table_c12Function · 0.80
in_table_c11_c12Function · 0.80
in_table_c21Function · 0.80
in_table_c22Function · 0.80
in_table_c21_c22Function · 0.80
in_table_c3Function · 0.80
in_table_c5Function · 0.80
test_categoryMethod · 0.80

Calls 4

abbr_nameMethod · 0.80
extract_charMethod · 0.80
to_ownedMethod · 0.45
to_charMethod · 0.45

Tested by 4

test_categoryMethod · 0.64