summaryrefslogtreecommitdiff
path: root/numpy/linalg
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-15 08:35:10 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-04-15 08:35:10 -0700
commit9361471ebf49d31761e8ed9d7dc6512abe3241a9 (patch)
tree8e01d8226aa0c6073a9c3cf8fbf9fdf88a175d5b /numpy/linalg
parenta196d789fbb8e72672c73ffcf99c687b5fd3ec3d (diff)
parentc6de09799decbb22bb2d7a44036f53c30356edda (diff)
downloadnumpy-9361471ebf49d31761e8ed9d7dc6512abe3241a9.tar.gz
Merge pull request #3249 from charris/2to3-apply-next-fixer
2to3: Apply next fixer.
Diffstat (limited to 'numpy/linalg')
-rw-r--r--numpy/linalg/lapack_lite/fortran.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/numpy/linalg/lapack_lite/fortran.py b/numpy/linalg/lapack_lite/fortran.py
index ce63b0990..3b6ac70f0 100644
--- a/numpy/linalg/lapack_lite/fortran.py
+++ b/numpy/linalg/lapack_lite/fortran.py
@@ -36,14 +36,19 @@ class LineIterator(object):
object.__init__(self)
self.iterable = iter(iterable)
self.lineno = 0
+
def __iter__(self):
return self
- def next(self):
+
+ def __next__(self):
self.lineno += 1
- line = self.iterable.next()
+ line = next(self.iterable)
line = line.rstrip()
return line
+ next = __next__
+
+
class PushbackIterator(object):
"""PushbackIterator(iterable)
@@ -59,15 +64,18 @@ class PushbackIterator(object):
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.buffer:
return self.buffer.pop()
else:
- return self.iterable.next()
+ return next(self.iterable)
def pushback(self, item):
self.buffer.append(item)
+ next = __next__
+
+
def fortranSourceLines(fo):
"""Return an iterator over statement lines of a Fortran source file.