[Numpy-discussion] Re: Trying out Numeric3

Stephen Walton stephen.walton at csun.edu
Fri Mar 25 14:54:04 EST 2005


Travis Oliphant wrote:

> Well, rank-0 arrays are and forever will be mutable.  But, Python 
> scalars (and the new Array-like Scalars) are not mutable.

This is a really minor point, and only slightly relevant to the 
discussion, and perhaps I'm just revealing my Python ignorance again, 
but:  what does it mean for a scalar to be mutable?  I can understand 
that one wants a[0]=7 to be allowed when a is a rank-0 array, and I also 
understand that str[k]='b' where str is a string is not allowed because 
strings are immutable.  But if I type "b=7" followed by "b=3", do I 
really care whether the 3 gets stuck in the same memory location 
previously occupied by the 7 (mutable) or the symbol b points to a new 
location containing a 3 (immutable)?  What are some circumstances where 
this might matter?





More information about the NumPy-Discussion mailing list