[Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)
Charles R Harris
Fri Mar 11 17:03:10 CST 2011
On Fri, Mar 11, 2011 at 12:37 PM, Pauli Virtanen <email@example.com> wrote:
> On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris wrote:
> > What about views? Wouldn't it be easier to write another object wrapping
> > an ndarray?
> I think the buffer interfaces and all other various ways Numpy provides
> exports for arrays make keeping tabs on modification impossible to do
> completely reliably.
I didn't mean wrap, as in subclass, I meant wrap in the sense of having
ndarray as a private component in a class. One could maybe make a class
factory that made a wholly new class for every freshly instanced monitor
object and access info could be kept in class variables. Every instance of
the generated class would essentially be a view of a single ndarray
I don't think all possible accesses could be caught, but for the purposes of
mc something less perfect would probably serve.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion