Dag Sverre Seljebotn wrote:

> The problem is that if you do
> 
> y = x
> x *= 2
> 
> then in current NumPy, y and x will still point to the same memory and 
> reference the same values (in fact, be the exact same view object).
> 
> Usual Python semantics seems to imply that what NumPy *should* have done 
> is let the latter line mean "x = x * 2"

I don't follow that. Usual Python semantics for in-place
operations on mutable types also leaves x and y referring
to the same object. Given the way Numpy defines the *
operator, it's doing exactly what I would expect here.

-- 
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to