(self, cast_type)
| 1886 | __nonzero__ = __bool__ # python 2 |
| 1887 | |
| 1888 | def _scalarfunc(self, cast_type): |
| 1889 | if self.size > 1: |
| 1890 | raise TypeError("Only length-1 arrays can be converted to Python scalars") |
| 1891 | else: |
| 1892 | return cast_type(self.compute().item()) |
| 1893 | |
| 1894 | def __int__(self): |
| 1895 | return self._scalarfunc(int) |
no test coverage detected