Noticed this while working on #299: While doing anything with the resulting pointer requires unsafe, producing the pointer should not. (Dereferencing self.as_array_ptr() should be safe for the same reasons that dereferencing it in say PyArray::shape is,
i.e. we ensure that PyArray<T,D> is only constructed for NumPy arrays.)
Noticed this while working on #299: While doing anything with the resulting pointer requires unsafe, producing the pointer should not. (Dereferencing
self.as_array_ptr()
should be safe for the same reasons that dereferencing it in sayPyArray::shape
is, i.e. we ensure thatPyArray<T,D>
is only constructed for NumPy arrays.)