(&self, vm: &VirtualMachine)
| 36 | |
| 37 | #[inline] |
| 38 | pub fn try_index(&self, vm: &VirtualMachine) -> PyResult<PyIntRef> { |
| 39 | self.try_index_opt(vm).transpose()?.ok_or_else(|| { |
| 40 | vm.new_type_error(format!( |
| 41 | "'{}' object cannot be interpreted as an integer", |
| 42 | self.class() |
| 43 | )) |
| 44 | }) |
| 45 | } |
| 46 | |
| 47 | pub fn try_int(&self, vm: &VirtualMachine) -> PyResult<PyIntRef> { |
| 48 | fn try_convert(obj: &PyObject, lit: &[u8], vm: &VirtualMachine) -> PyResult<PyIntRef> { |
no test coverage detected