(&self, value: PyObjectRef, vm: &VirtualMachine)
| 750 | |
| 751 | #[pymethod] |
| 752 | fn count(&self, value: PyObjectRef, vm: &VirtualMachine) -> PyResult<usize> { |
| 753 | self.try_not_released(vm)?; |
| 754 | if self.desc.ndim() != 1 { |
| 755 | return Err( |
| 756 | vm.new_not_implemented_error("multi-dimensional sub-views are not implemented") |
| 757 | ); |
| 758 | } |
| 759 | let len = self.desc.dim_desc[0].0; |
| 760 | let mut count = 0; |
| 761 | for i in 0..len { |
| 762 | let item = self.getitem_by_idx(i as isize, vm)?; |
| 763 | if vm.bool_eq(&item, &value)? { |
| 764 | count += 1; |
| 765 | } |
| 766 | } |
| 767 | Ok(count) |
| 768 | } |
| 769 | |
| 770 | #[pymethod] |
| 771 | fn index( |
nothing calls this directly
no test coverage detected