def finalize(self):
        if self.ct == 0:
            return
        elif self.ct == 1:
            return 0

        prev = min_diff = None

        while self.heap:
            if min_diff is None:
                if prev is None:
                    prev = heapq.heappop(self.heap)
                    continue
            curr = heapq.heappop(self.heap)
            diff = prev - curr
            if min_diff is None or min_diff > diff:
                min_diff = diff
            prev = curr
        return min_diff
dataset/ETHPy150Open coleifer/peewee/playhouse/sqlite_udf.py/minrange.finalize/swapped operands of `-`