(&self, length: ArgIndex, vm: &VirtualMachine)
| 235 | |
| 236 | #[pymethod] |
| 237 | fn indices(&self, length: ArgIndex, vm: &VirtualMachine) -> PyResult<PyTupleRef> { |
| 238 | let length = length.into_int_ref(); |
| 239 | let length = length.as_bigint(); |
| 240 | if length.is_negative() { |
| 241 | return Err(vm.new_value_error("length should not be negative.")); |
| 242 | } |
| 243 | let (start, stop, step) = self.inner_indices(length, vm)?; |
| 244 | Ok(vm.new_tuple((start, stop, step))) |
| 245 | } |
| 246 | |
| 247 | #[allow(clippy::type_complexity)] |
| 248 | #[pymethod] |