[Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

Charles R Harris charlesr.harris@gmail....
Fri Mar 11 17:03:10 CST 2011


On Fri, Mar 11, 2011 at 12:37 PM, Pauli Virtanen <pav@iki.fi> wrote:

> On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris wrote:
> [clip]
> > 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
instance.

I don't think all possible accesses could be caught, but for the purposes of
mc something less perfect would probably serve.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110311/7c0100e9/attachment.html 


More information about the NumPy-Discussion mailing list