class fib(object):

  def __init__ (self,low,high):

    self.i=1 # first term
    self.j=1 # second term
    self.current=low # Starting Point
    self.high=high # Ending point

    while self.i<self.current:

      self.aux=self.i
      self.i=self.j
      self.j+=self.aux

    self.current=self.i # Setting current for the first Fib. number>low

  def __iter__(self):
      return self

  def next (self):

    self.current=self.i
    self.i=self.j
    self.j+=self.current

    if self.current>self.high:
      raise StopIteration # raise a stop iteration if current>high
    else:
      return self.current

print [i for i in fib(0,1e12)]


