examples/classes/range/it.py
class Range(object):
   def __init__(self, start, end):
     self.current = start
     self.end = end

   def __iter__(self):
     return self

   def next(self):
      if self.current >= self.end:
         raise StopIteration
      v = self.current
      self.current += 1
      return v
examples/classes/range/count.py
import it

r = it.Range(1, 4)
for n in r:
   print(n)

print('---')

for n in it.Range(2, 5):
   print(n)