def cream(self, v):
        """Replace top entry in priority queue with v, then return best"""
        if 0 < len(self) and self._a[1] < v:  # comparison with v
            r = self._a[1]
            leaf = self._holetoleaf(1)
            self._bubbleup(leaf, v)
        else:
            r = v
        return r
Replace top entry in priority queue with v, then return best
recipes/Python/81693_Heapbased_priority_queue/recipe-81693.py