[Edu-sig] Properties use case
mtobis at gmail.com
Thu Mar 16 04:34:13 CET 2006
A Numeric array is mutable; it refers to allocated memory. So any
subpart of it is mutable. So I suggest you use a 1-element complex
numeric array as your mutable complex type.
>>> import Numeric as N
>>> a = N.ones((20,20),N.Complex)
>>> b = N.ravel(a[1:2,1:2])
>>> b += 1 + 1j
Admittedly the str() of this object is ugly, and because Numeric isn't
inheritance-friendly this is hard to work around elegantly. If this is
a problem it might provide the occasion to upgrade to a newer
Still, why do you care about mutability of your complex number
instances once they are outside Numeric? That seems unusual.
More information about the Edu-sig