(&self, vm: &VirtualMachine)
| 615 | |
| 616 | #[pygetset] |
| 617 | fn suboffsets(&self, vm: &VirtualMachine) -> PyResult<PyTupleRef> { |
| 618 | self.try_not_released(vm)?; |
| 619 | let has_suboffsets = self |
| 620 | .desc |
| 621 | .dim_desc |
| 622 | .iter() |
| 623 | .any(|(_, _, suboffset)| *suboffset != 0); |
| 624 | if has_suboffsets { |
| 625 | Ok(vm.ctx.new_tuple( |
| 626 | self.desc |
| 627 | .dim_desc |
| 628 | .iter() |
| 629 | .map(|(_, _, suboffset)| suboffset.to_pyobject(vm)) |
| 630 | .collect(), |
| 631 | )) |
| 632 | } else { |
| 633 | Ok(vm.ctx.empty_tuple.clone()) |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | #[pygetset] |
| 638 | fn format(&self, vm: &VirtualMachine) -> PyResult<PyStr> { |
nothing calls this directly
no test coverage detected