Equivalent to "x = heap.popmin(); heap.push(); return x" but more efficient.
(self, item)
| 28 | return self._unwrap(heapq.heappop(self._lst)) |
| 29 | |
| 30 | def replace(self, item): |
| 31 | '''Equivalent to "x = heap.popmin(); heap.push(); return x" but more |
| 32 | efficient. |
| 33 | ''' |
| 34 | return self._unwrap(heapq.heapreplace(self._lst, self._wrap(item))) |
| 35 | |
| 36 | def pushpop(self, item): |
| 37 | 'Equivalent to "heap.push(); return heap.popmin()" but more efficient.' |