(descr: &PyDescriptorOwned, vm: &VirtualMachine)
| 246 | } |
| 247 | |
| 248 | fn calculate_qualname(descr: &PyDescriptorOwned, vm: &VirtualMachine) -> PyResult<Option<String>> { |
| 249 | if let Some(qualname) = vm.get_attribute_opt(descr.typ.clone().into(), "__qualname__")? { |
| 250 | let str = qualname.downcast::<PyStr>().map_err(|_| { |
| 251 | vm.new_type_error("<descriptor>.__objclass__.__qualname__ is not a unicode object") |
| 252 | })?; |
| 253 | Ok(Some(format!("{}.{}", str, descr.name))) |
| 254 | } else { |
| 255 | Ok(None) |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | #[pyclass(with(GetDescriptor, Representable), flags(DISALLOW_INSTANTIATION))] |
| 260 | impl PyMemberDescriptor { |
no test coverage detected