summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2008-06-17 22:54:05 +0000
committerpierregm <pierregm@localhost>2008-06-17 22:54:05 +0000
commit00827d75565a543ad4e1ca5c2d418eb9fafdf7fb (patch)
tree0fe72ab2e9725f1b12ee2a29f51daa79bd85e8db
parent660dacef79bf3e78502309f791b3195b14fa63df (diff)
downloadnumpy-00827d75565a543ad4e1ca5c2d418eb9fafdf7fb.tar.gz
fixed dictionary update for compatibility with Python 2.3
-rw-r--r--numpy/ma/core.py9
-rw-r--r--numpy/ma/mrecords.py2
-rw-r--r--numpy/ma/tests/test_core.py2
3 files changed, 7 insertions, 6 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 7a11e1eb6..ce71254f1 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -110,12 +110,13 @@ default_filler = {'b': True,
'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.
diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py
index ba4b0f915..c7120404b 100644
--- a/numpy/ma/mrecords.py
+++ b/numpy/ma/mrecords.py
@@ -170,7 +170,7 @@ class MaskedRecords(MaskedArray, object):
_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):
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index bc9168082..9203e575e 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -878,7 +878,7 @@ class TestFillingValues(TestCase):
# 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])