summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2008-07-01 22:01:09 +0000
committerpierregm <pierregm@localhost>2008-07-01 22:01:09 +0000
commitbc01c96daf61de61046c5ac7d17a80ab35ccd0ef (patch)
tree5341917c8f548535812a202c57188d85e8781e08
parentf843a88032ebe1f4847dfb97996413fac56b227d (diff)
downloadnumpy-bc01c96daf61de61046c5ac7d17a80ab35ccd0ef.tar.gz
prevent .reshape to update the whole __dict__ of the result, use ._update_from instead
-rw-r--r--numpy/ma/core.py2
-rw-r--r--numpy/ma/testutils.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 02dc6ef68..d4c0cb359 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -2015,7 +2015,7 @@ masked_%(name)s(data = %(data)s,
"""
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
diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py
index f1749619d..a2fde4405 100644
--- a/numpy/ma/testutils.py
+++ b/numpy/ma/testutils.py
@@ -99,7 +99,7 @@ def assert_equal(actual,desired,err_msg=''):
# 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)