summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-07 15:33:46 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-04-07 15:33:46 -0700
commit1340fa646d414b49856314bad339b4ae8ea4c4d8 (patch)
tree20fce4d1fe391d3afca4e32245c59fdc2e6d2601 /numpy/lib
parent756d13449aa3d0b6be4439e87c5cb520c419d30b (diff)
parent6339930ff42f52259e898b18eb6e9dd7d1be4f86 (diff)
downloadnumpy-1340fa646d414b49856314bad339b4ae8ea4c4d8.tar.gz
Merge pull request #3205 from charris/2to3-apply-dict-fixer
2to3: apply `dict` fixer.
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/_datasource.py2
-rw-r--r--numpy/lib/arraypad.py2
-rw-r--r--numpy/lib/format.py2
-rw-r--r--numpy/lib/npyio.py4
-rw-r--r--numpy/lib/recfunctions.py2
-rw-r--r--numpy/lib/tests/test_io.py4
-rw-r--r--numpy/lib/utils.py2
7 files changed, 9 insertions, 9 deletions
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py
index 13060593d..2d35065b0 100644
--- a/numpy/lib/_datasource.py
+++ b/numpy/lib/_datasource.py
@@ -104,7 +104,7 @@ class _FileOpeners(object):
"""
self._load()
- return self._file_openers.keys()
+ return list(self._file_openers.keys())
def __getitem__(self, key):
self._load()
return self._file_openers[key]
diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py
index de909bc87..8a7c3a067 100644
--- a/numpy/lib/arraypad.py
+++ b/numpy/lib/arraypad.py
@@ -754,7 +754,7 @@ def pad(array, pad_width, mode=None, **kwargs):
kwargs[i] = _normalize_shape(narray, kwargs[i])
elif mode == None:
raise ValueError('Keyword "mode" must be a function or one of %s.' %
- (modefunc.keys(),))
+ (list(modefunc.keys()),))
else:
# User supplied function, I hope
function = mode
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 93d20fa4c..886ba45b3 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -344,7 +344,7 @@ def read_array_header_1_0(fp):
if not isinstance(d, dict):
msg = "Header is not a dictionary: %r"
raise ValueError(msg % d)
- keys = d.keys()
+ keys = list(d.keys())
keys.sort()
if keys != ['descr', 'fortran_order', 'shape']:
msg = "Header does not contain the correct keys: %r"
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 14d41a3c1..7f66fb141 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -572,7 +572,7 @@ def _savez(file, args, kwds, compress):
fd, tmpfile = tempfile.mkstemp(suffix='-numpy.npy')
os.close(fd)
try:
- for key, val in namedict.iteritems():
+ for key, val in namedict.items():
fname = key + '.npy'
fid = open(tmpfile, 'wb')
try:
@@ -811,7 +811,7 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None,
packing = [(N, tuple)]
# By preference, use the converters specified by the user
- for i, conv in (user_converters or {}).iteritems():
+ for i, conv in (user_converters or {}).items():
if usecols:
try:
i = usecols.index(i)
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
index b96186bbd..a9f480f5d 100644
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -317,7 +317,7 @@ def _fix_defaults(output, defaults=None):
"""
names = output.dtype.names
(data, mask, fill_value) = (output.data, output.mask, output.fill_value)
- for (k, v) in (defaults or {}).iteritems():
+ for (k, v) in (defaults or {}).items():
if k in names:
fill_value[k] = v
data[k][mask[k]] = v
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 43739c53c..af4eed05d 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -1620,7 +1620,7 @@ def test_npzfile_dict():
assert_('x' in z.keys())
assert_('y' in z.keys())
- for f, a in z.iteritems():
+ for f, a in z.items():
assert_(f in ['x', 'y'])
assert_equal(a.shape, (3, 3))
@@ -1629,7 +1629,7 @@ def test_npzfile_dict():
for f in z:
assert_(f in ['x', 'y'])
- assert_('x' in list(z.iterkeys()))
+ assert_('x' in z.keys())
def test_load_refcount():
# Check that objects returned by np.load are directly freed based on
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 4ed534455..75ba5bca6 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -755,7 +755,7 @@ def lookfor(what, module=None, import_modules=True, regenerate=False,
whats = str(what).lower().split()
if not whats: return
- for name, (docstring, kind, index) in cache.iteritems():
+ for name, (docstring, kind, index) in cache.items():
if kind in ('module', 'object'):
# don't show modules or objects
continue