Skip to content

Commit 0268841

Browse files
committed
Simplify: use next = __next__
1 parent d424304 commit 0268841

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/units/basic_units.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,10 @@ class IteratorProxy(object):
158158
def __init__(self, iter, unit):
159159
self.iter = iter
160160
self.unit = unit
161-
def next(self):
162-
value = self.iter.next()
163-
return TaggedValue(value, self.unit)
164161
def __next__(self):
165162
value = next(self.iter)
166163
return TaggedValue(value, self.unit)
164+
next = __next__ # for Python 2
167165
return IteratorProxy(iter(self.value), self.unit)
168166

169167
def get_compressed_copy(self, mask):

0 commit comments

Comments
 (0)