(&self, vm: &VirtualMachine)
| 25 | } |
| 26 | |
| 27 | pub fn try_index_opt(&self, vm: &VirtualMachine) -> Option<PyResult<PyIntRef>> { |
| 28 | if let Some(i) = self.downcast_ref_if_exact::<PyInt>(vm) { |
| 29 | Some(Ok(i.to_owned())) |
| 30 | } else if let Some(i) = self.downcast_ref::<PyInt>() { |
| 31 | Some(Ok(vm.ctx.new_bigint(i.as_bigint()))) |
| 32 | } else { |
| 33 | self.number().index(vm) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | #[inline] |
| 38 | pub fn try_index(&self, vm: &VirtualMachine) -> PyResult<PyIntRef> { |
no test coverage detected