Re: python references

2007-02-05 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > >>> from Numeric import zeros > >>> p=zeros(3) > >>> p > array([0,0,0]) > >>> p[0] > 0 > >>> x=p[0] `x' is now a reference to immutable integer object with value 0, not to first element of array `p' > >>> x=10 now `x' is a reference to immutable integer object with va

Re: python references

2007-02-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: from Numeric import zeros p=zeros(3) p > array([0,0,0]) p[0] > 0 x=p[0] x=10 p > array([0,0,0]) #actual behavior > #array([10,0,0]) #desired behavior > > I want x to be a C++-esque reference to p[0] for convenience in a > vector3 class.