Next point in iteration

def next(self):
        """Next point in iteration
        """
        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