Equivalent to "heap.push(); return heap.popmin()" but more efficient.
(self, item)
| 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.' |
| 38 | if self and self[0] < item: |
| 39 | return self.replace(item) |
| 40 | return item |
| 41 | |
| 42 | def iterpop(self): |
| 43 | '''Return a destructive iterator over the heap's elements. |