summaryrefslogtreecommitdiff
path: root/numpy/lib/arrayterator.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/arrayterator.py')
-rw-r--r--numpy/lib/arrayterator.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/numpy/lib/arrayterator.py b/numpy/lib/arrayterator.py
index c16668582..b9ea21f8e 100644
--- a/numpy/lib/arrayterator.py
+++ b/numpy/lib/arrayterator.py
@@ -7,17 +7,13 @@ an array object, and when iterated it will return sub-arrays with at most
a user-specified number of elements.
"""
-from __future__ import division, absolute_import, print_function
-
from operator import mul
from functools import reduce
-from numpy.compat import long
-
__all__ = ['Arrayterator']
-class Arrayterator(object):
+class Arrayterator:
"""
Buffered iterator for big arrays.
@@ -110,7 +106,7 @@ class Arrayterator(object):
if slice_ is Ellipsis:
fixed.extend([slice(None)] * (dims-length+1))
length = len(fixed)
- elif isinstance(slice_, (int, long)):
+ elif isinstance(slice_, int):
fixed.append(slice(slice_, slice_+1, 1))
else:
fixed.append(slice_)
@@ -163,8 +159,7 @@ class Arrayterator(object):
"""
for block in self:
- for value in block.flat:
- yield value
+ yield from block.flat
@property
def shape(self):