问题描述:
Write a function to delete the smallest element from the given heap and then insert a new item.

测试用例:
['assert heap_replace( [25, 44, 68, 21, 39, 23, 89],21)==[21, 25, 23, 44, 39, 68, 89]', 'assert heap_replace([25, 44, 68, 21, 39, 23, 89],110)== [23, 25, 68, 44, 39, 110, 89]', 'assert heap_replace([25, 44, 68, 21, 39, 23, 89],500)==[23, 25, 68, 44, 39, 500, 89]']

生成的代码:
import heapq

def heap_replace(heap, new_item):
    heapq.heappop(heap)
    heapq.heappush(heap, new_item)
    return heap