(&self, vm: &VirtualMachine)
| 76 | } |
| 77 | |
| 78 | pub fn try_mapping(&self, vm: &VirtualMachine) -> PyResult<PyMapping<'_>> { |
| 79 | let mapping = self.mapping_unchecked(); |
| 80 | if mapping.check() { |
| 81 | Ok(mapping) |
| 82 | } else { |
| 83 | Err(vm.new_type_error(format!("{} is not a mapping object", self.class()))) |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | #[derive(Copy, Clone)] |
no test coverage detected