def pushpop(self, item):
        "Push the item onto the heap and then pop the smallest value"
        if self and self[0] < item:
            return heapq.heapreplace(self, item)
        return item
Push the item onto the heap and then pop the smallest value
recipes/Python/437116_Wrapper_class_heapq/recipe-437116.py