()
| 32 | |
| 33 | |
| 34 | def test_array_called(): |
| 35 | class Wrapper: |
| 36 | val = '0' * 100 |
| 37 | def __array__(self, result=None): |
| 38 | return np.array([self.val], dtype=object) |
| 39 | |
| 40 | |
| 41 | wrapped = Wrapper() |
| 42 | arr = np.array(wrapped, dtype=str) |
| 43 | assert arr.dtype == 'U100' |
| 44 | assert arr[0] == Wrapper.val |