[Numpy-svn] r8095 - trunk/numpy/ma

numpy-svn@scip... numpy-svn@scip...
Mon Feb 8 01:35:34 CST 2010


Author: pierregm
Date: 2010-02-08 01:35:34 -0600 (Mon, 08 Feb 2010)
New Revision: 8095

Modified:
   trunk/numpy/ma/core.py
Log:
* allow fill_value to be np.void

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2010-02-08 06:21:33 UTC (rev 8094)
+++ trunk/numpy/ma/core.py	2010-02-08 07:35:34 UTC (rev 8095)
@@ -394,7 +394,7 @@
             fill_value = default_fill_value(ndtype)
     elif fields:
         fdtype = [(_[0], _[1]) for _ in ndtype.descr]
-        if isinstance(fill_value, ndarray):
+        if isinstance(fill_value, (ndarray, np.void)):
             try:
                 fill_value = np.array(fill_value, copy=False, dtype=fdtype)
             except ValueError:
@@ -2733,9 +2733,6 @@
         # But don't run the check unless we have something to check....
         if fill_value is not None:
             _data._fill_value = _check_fill_value(fill_value, _data.dtype)
-        elif names_:
-            # Named fields: make sure _fill_value is initialized
-            _data._fill_value = _check_fill_value(None, _data.dtype)
         # Process extra options ..
         if hard_mask is None:
             _data._hardmask = getattr(data, '_hardmask', False)



More information about the Numpy-svn mailing list