[Numpy-svn] r5292 - in trunk/numpy/ma: . tests

numpy-svn@scip... numpy-svn@scip...
Tue Jun 17 17:54:08 CDT 2008


Author: pierregm
Date: 2008-06-17 17:54:05 -0500 (Tue, 17 Jun 2008)
New Revision: 5292

Modified:
   trunk/numpy/ma/core.py
   trunk/numpy/ma/mrecords.py
   trunk/numpy/ma/tests/test_core.py
Log:
fixed dictionary update for compatibility with Python 2.3

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2008-06-17 20:08:28 UTC (rev 5291)
+++ trunk/numpy/ma/core.py	2008-06-17 22:54:05 UTC (rev 5292)
@@ -110,13 +110,14 @@
                   'V' : '???',
                   }
 max_filler = ntypes._minvals
-max_filler.update([(k, -np.inf) for k in [np.float32, np.float64]])
+max_filler.update(dict([(k, -np.inf) for k in [np.float32, np.float64]]))
 min_filler = ntypes._maxvals
-min_filler.update([(k, +np.inf) for k in [np.float32, np.float64]])
+min_filler.update(dict([(k, +np.inf) for k in [np.float32, np.float64]]))
 if 'float128' in ntypes.typeDict:
-    max_filler.update([(np.float128, -np.inf)])
-    min_filler.update([(np.float128, +np.inf)])
+    max_filler[np.float128] = -np.inf
+    min_filler[np.float128] = +np.inf
 
+
 def default_fill_value(obj):
     """Calculate the default fill value for the argument object.
 

Modified: trunk/numpy/ma/mrecords.py
===================================================================
--- trunk/numpy/ma/mrecords.py	2008-06-17 20:08:28 UTC (rev 5291)
+++ trunk/numpy/ma/mrecords.py	2008-06-17 22:54:05 UTC (rev 5292)
@@ -170,7 +170,7 @@
         _locdict = self.__dict__
         if _locdict['_baseclass'] == ndarray:
             _locdict['_baseclass'] = recarray
-        _locdict.update(_mask=_mask, _fieldmask=_mask)
+        _locdict.update({'_mask':_mask, '_fieldmask':_mask})
         return
 
     def _getdata(self):

Modified: trunk/numpy/ma/tests/test_core.py
===================================================================
--- trunk/numpy/ma/tests/test_core.py	2008-06-17 20:08:28 UTC (rev 5291)
+++ trunk/numpy/ma/tests/test_core.py	2008-06-17 22:54:05 UTC (rev 5292)
@@ -878,7 +878,7 @@
         # We had a tailored comment to make sure special attributes are properly
         # dealt with
         a = array(['3', '4', '5'])
-        a._basedict.update(comment="updated!")
+        a._basedict.update({'comment':"updated!"})
         #
         b = array(a, dtype=int)
         assert_equal(b._data, [3,4,5])



More information about the Numpy-svn mailing list