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

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Jul 3 12:29:37 EDT 2008


Author: pierregm
Date: 2008-07-03 11:29:36 -0500 (Thu, 03 Jul 2008)
New Revision: 5345

Modified:
   branches/1.1.x/numpy/ma/core.py
Log:
Avoid updating the __dict__ of the result in .reshape

Modified: branches/1.1.x/numpy/ma/core.py
===================================================================
--- branches/1.1.x/numpy/ma/core.py	2008-07-03 16:27:58 UTC (rev 5344)
+++ branches/1.1.x/numpy/ma/core.py	2008-07-03 16:29:36 UTC (rev 5345)
@@ -1867,10 +1867,10 @@
 
         """
         result = self._data.reshape(*s).view(type(self))
-        result.__dict__.update(self.__dict__)
-        if result._mask is not nomask:
-            result._mask = self._mask.copy()
-            result._mask.shape = result.shape
+        result._update_from(self)
+        mask = self._mask
+        if mask is not nomask:
+            result._mask = mask.reshape(*s)
         return result
     #
     def resize(self, newshape, refcheck=True, order=False):




More information about the Numpy-svn mailing list