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

numpy-svn@scip... numpy-svn@scip...
Tue Jul 1 17:01:19 CDT 2008


Author: pierregm
Date: 2008-07-01 17:01:09 -0500 (Tue, 01 Jul 2008)
New Revision: 5329

Modified:
   trunk/numpy/ma/core.py
   trunk/numpy/ma/testutils.py
Log:
prevent .reshape to update the whole __dict__ of the result, use ._update_from instead

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2008-07-01 15:20:23 UTC (rev 5328)
+++ trunk/numpy/ma/core.py	2008-07-01 22:01:09 UTC (rev 5329)
@@ -2015,7 +2015,7 @@
 
         """
         result = self._data.reshape(*s).view(type(self))
-        result.__dict__.update(self.__dict__)
+        result._update_from(self)
         if result._mask is not nomask:
             result._mask = self._mask.copy()
             result._mask.shape = result.shape

Modified: trunk/numpy/ma/testutils.py
===================================================================
--- trunk/numpy/ma/testutils.py	2008-07-01 15:20:23 UTC (rev 5328)
+++ trunk/numpy/ma/testutils.py	2008-07-01 22:01:09 UTC (rev 5329)
@@ -99,7 +99,7 @@
     # Case #4. arrays or equivalent
     if ((actual is masked) and not (desired is masked)) or \
         ((desired is masked) and not (actual is masked)):
-        msg = build_err_msg([actual, desired], 
+        msg = build_err_msg([actual, desired],
                             err_msg, header='', names=('x', 'y'))
         raise ValueError(msg)
     actual = np.array(actual, copy=False, subok=True)



More information about the Numpy-svn mailing list