| 868 | # isinstance(x, collections.abc.Iterable). |
| 869 | |
| 870 | class ArraySubclass(np.ndarray): |
| 871 | |
| 872 | def __iter__(self): |
| 873 | for value in super().__iter__(): |
| 874 | yield np.array(value) |
| 875 | |
| 876 | def __getitem__(self, item): |
| 877 | return np.array(super().__getitem__(item)) |
| 878 | |
| 879 | v = np.arange(10, dtype=float) |
| 880 | x = ArraySubclass((10,), dtype=float, buffer=v.data) |
no outgoing calls
searching dependent graphs…