Re: [Numpy-discussion] Shared memory check on in-place modification.

2015-08-07 Thread srean
I got_misled_by (extrapolated erroneously from) this description of temporaries in the documentation http://docs.scipy.org/doc/numpy/user/basics.indexing.html#assigning-values-to-indexed-arrays ,,,])]" ... new array is extracted from the original (as a temporary) containing the values at 1, 1, 3,

Re: [Numpy-discussion] Shared memory check on in-place modification.

2015-08-07 Thread Sebastian Berg
On Fr, 2015-08-07 at 13:14 +0530, srean wrote: > Wait, when assignments and slicing mix wasn't the behavior supposed to > be equivalent to copying the RHS to a temporary and then assigning > using the temporary. Is that a false memory ? Or has the behavior > changed ? As long as the behavior is wel

Re: [Numpy-discussion] Shared memory check on in-place modification.

2015-08-07 Thread srean
Wait, when assignments and slicing mix wasn't the behavior supposed to be equivalent to copying the RHS to a temporary and then assigning using the temporary. Is that a false memory ? Or has the behavior changed ? As long as the behavior is well defined and succinct it should be ok On Tuesday, Ju

Re: [Numpy-discussion] Shared memory check on in-place modification.

2015-07-28 Thread Sebastian Berg
On Mon Jul 27 22:51:52 2015 GMT+0200, Sturla Molden wrote: > On 27/07/15 22:10, Anton Akhmerov wrote: > > Hi everyone, > > > > I have encountered an initially rather confusing problem in a piece of > > code that attempted to symmetrize a matrix: `h += h.T` > > The problem of course appears due to

Re: [Numpy-discussion] Shared memory check on in-place modification.

2015-07-27 Thread Sturla Molden
On 27/07/15 22:10, Anton Akhmerov wrote: > Hi everyone, > > I have encountered an initially rather confusing problem in a piece of > code that attempted to symmetrize a matrix: `h += h.T` > The problem of course appears due to `h.T` being a view of `h`, and > some elements being overwritten during

[Numpy-discussion] Shared memory check on in-place modification.

2015-07-27 Thread Anton Akhmerov
Hi everyone, I have encountered an initially rather confusing problem in a piece of code that attempted to symmetrize a matrix: `h += h.T` The problem of course appears due to `h.T` being a view of `h`, and some elements being overwritten during the __iadd__ call. What made it nasty is that it app