Re: [Numpy-discussion] feature request - increment counter on write check

2015-09-11 Thread Daniel
Nathaniel Smith wrote > Actually, now that I think about it there is a much worse general version > of this problem, which probably kills the idea dead. Via the buffer > interface (among others), it is totally legal and encouraged to create > non-numpy views of numpy arrays. They'll check the

Re: [Numpy-discussion] feature request - increment counter on write check

2015-09-11 Thread Daniel
Anne Archibald-3 wrote > ... You'd also have to make sure that all code that tries to write to an > array really checks the writable flag. If there is code out there which modifies arrays without checking the write flag then it's already on buggy-territory. In terms of value vs functions, surely

Re: [Numpy-discussion] feature request - increment counter on write check

2015-09-11 Thread Anne Archibald
On Fri, Sep 11, 2015 at 3:20 PM Sebastian Berg wrote: > On Fr, 2015-09-11 at 13:10 +, Daniel Manson wrote: > > Originally posted as issue 6301 on github. > > > > > > Presumably any block of code that modifies an ndarray's buffer is > > wrapped in a (thread safe?)

Re: [Numpy-discussion] feature request - increment counter on write check

2015-09-11 Thread Daniel
>...you would have to "notify" the array itself that it has changed.. I don't get what you mean..or maybe I do...? Do you mean that if there are two arrays with non-overlapping views of the same data then modifying one will change the mutablehash of both? That's true I guess, and I hadn't

Re: [Numpy-discussion] feature request - increment counter on write check

2015-09-11 Thread Sebastian Berg
On Fr, 2015-09-11 at 06:00 -0700, Daniel wrote: > >...you would have to "notify" the array itself that it has changed.. > > I don't get what you mean..or maybe I do...? Do you mean that if there are > two arrays with non-overlapping views of the same data then modifying one > will change the

[Numpy-discussion] feature request - increment counter on write check

2015-09-11 Thread Daniel Manson
Originally posted as issue 6301 on github. Presumably any block of code that modifies an ndarray's buffer is wrapped in a (thread safe?) check of the writable flag. Would it be possible to hold a counter rather than a simple bool flag and then

Re: [Numpy-discussion] feature request - increment counter on write check

2015-09-11 Thread Sebastian Berg
On Fr, 2015-09-11 at 13:10 +, Daniel Manson wrote: > Originally posted as issue 6301 on github. > > > Presumably any block of code that modifies an ndarray's buffer is > wrapped in a (thread safe?) check of the writable flag. Would it be > possible to hold a counter rather than a simple bool