code: def next(self):
          
          while True:
              x, y = next(self.scan)
              if self.predicate is not None and not self.predicate(x,y):
                  if self.abort: raise StopIteration("Boundary crossed!")
              elif (x < self.minx or
                  x > self.maxx or
                  y < self.miny or
                  y > self.maxy):
                  if self.abort: raise StopIteration("Boundary crossed!")
              else:
                  return x, y
docs: Next point in iteration