(zelf: &Py<Self>, vm: &VirtualMachine)
| 175 | |
| 176 | impl Representable for PyStaticMethod { |
| 177 | fn repr_str(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<String> { |
| 178 | let callable = zelf.callable.lock().repr(vm).unwrap(); |
| 179 | let class = Self::class(&vm.ctx); |
| 180 | |
| 181 | match ( |
| 182 | class |
| 183 | .__qualname__(vm) |
| 184 | .downcast_ref::<PyStr>() |
| 185 | .map(|n| n.as_wtf8()), |
| 186 | class |
| 187 | .__module__(vm) |
| 188 | .downcast_ref::<PyStr>() |
| 189 | .map(|m| m.as_wtf8()), |
| 190 | ) { |
| 191 | (None, _) => Err(vm.new_type_error("Unknown qualified name")), |
| 192 | (Some(qualname), Some(module)) if module != "builtins" => { |
| 193 | Ok(format!("<{module}.{qualname}({callable})>")) |
| 194 | } |
| 195 | _ => Ok(format!("<{}({})>", class.slot_name(), callable)), |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | pub fn init(context: &'static Context) { |
nothing calls this directly
no test coverage detected