[Numpy-svn] r5499 - branches/1.1.x/numpy/ma

numpy-svn@scip... numpy-svn@scip...
Tue Jul 22 11:37:56 CDT 2008


Author: charris
Date: 2008-07-22 11:37:54 -0500 (Tue, 22 Jul 2008)
New Revision: 5499

Modified:
   branches/1.1.x/numpy/ma/mrecords.py
Log:
Fix Python2.3 incompatibility.

Modified: branches/1.1.x/numpy/ma/mrecords.py
===================================================================
--- branches/1.1.x/numpy/ma/mrecords.py	2008-07-22 15:12:12 UTC (rev 5498)
+++ branches/1.1.x/numpy/ma/mrecords.py	2008-07-22 16:37:54 UTC (rev 5499)
@@ -240,9 +240,8 @@
             fillval = _check_fill_value(None, ddtype)
             # We can't use ddtype to reconstruct the array as we don't need...
             # ... the shape of the fields
-            self._fill_value = np.array(tuple(fillval),
-                                        dtype=zip(ddtype.names, 
-                                                  (_[1] for _ in ddtype.descr)))
+            dt = zip(ddtype.names, [s[1] for s in ddtype.descr])
+            self._fill_value = np.array(tuple(fillval), dtype=dt)
         return self._fill_value
 
     def set_fill_value(self, value=None):
@@ -796,7 +795,7 @@
 ###############################################################################
 if __name__ == '__main__':
     from numpy.ma.testutils import assert_equal
-    
+
     if 1:
         ilist = [1,2,3,4,5]
         flist = [1.1,2.2,3.3,4.4,5.5]
@@ -805,4 +804,4 @@
         mask = [0,1,0,0,1]
         base = ma.array(zip(ilist,flist,slist), mask=mask, dtype=ddtype)
         mbase = base.view(mrecarray)
-        mbase._mask = nomask
\ No newline at end of file
+        mbase._mask = nomask



More information about the Numpy-svn mailing list