[Numpy-discussion] Changing "nomask" in numpy.ma

Sasha ndarray at mac.com
Tue Jan 17 13:34:01 CST 2006

I would like to propose to change the default value of the mask array
of the ma objects from None to bool_(0).  This will allow ma to take
advantage of numpy scalars providing array interface.  For example a
check that now has to be written as "a.mask is not None and
a.mask.any()" can become just a.mask.any().  Ma will still use a
singleton value for an empty mask so that the code that relies on
"a.mask is  None" check can be changed to "a.mask is nomask".  Any

-- sasha

PS: Somewhat related:
 >>> from numpy import *
>>> bool_(0) is bool_(0)
>>> bool(0) is bool(0)

Is there any reason not to intern numpy's bool_'s?

-- sasha

More information about the Numpy-discussion mailing list