Hi,
Was it ever brought up the possibility of a new array class (ndrefonly, ndview) that is strictly no copy?
All operations on ndrefonly will return ndrefonly and if the operation cannot be completed without making a copy, it shall throw an error.
On the implementation there are two choices if we use subclasses:
- ndrefonly can be a subclass of ndarray. The pattern would be subclass limiting functionality of super, but ndrefonly is a ndarray.
- ndarray as a subclass of ndarray. Subclass supplements functionality of super. : ndarray will not throw an error when a copy is necessary. However ndarray is not a ndarray.
If we want to be wild they do not even need to be subclasses of each other, or maybe they shall both be subclasses of something more fundamental.
- Yu