1.1 --- a/lib/__builtins__/span.py Fri Mar 10 15:21:08 2017 +0100
1.2 +++ b/lib/__builtins__/span.py Fri Mar 10 17:27:18 2017 +0100
1.3 @@ -79,20 +79,19 @@
1.4
1.5 "Return an iterator, currently self."
1.6
1.7 - return xrangeiterator(self)
1.8 + return xrangeiterator(self.start, self.step, self.__len__())
1.9
1.10 class xrangeiterator:
1.11
1.12 "An iterator over an xrange."
1.13
1.14 - def __init__(self, obj):
1.15 + def __init__(self, start, step, count):
1.16
1.17 "Initialise the iterator with the given 'obj'."
1.18
1.19 - self.start = obj.start
1.20 - self.count = obj.__len__()
1.21 - self.step = obj.step
1.22 - self.current = obj.start
1.23 + self.current = start
1.24 + self.step = step
1.25 + self.count = count
1.26
1.27 def next(self):
1.28
1.29 @@ -102,8 +101,8 @@
1.30 raise StopIteration
1.31
1.32 current = self.current
1.33 - self.current += self.step
1.34 - self.count -= 1
1.35 + self.current = self.current.__add__(self.step)
1.36 + self.count = self.count.__sub__(1)
1.37 return current
1.38
1.39 def range(start_or_end, end=None, step=1):