Lines Matching refs:item
123 item: object
126 Push item onto heap, maintaining the heap invariant.
130 _heapq_heappush_impl(PyObject *module, PyObject *heap, PyObject *item)
133 if (PyList_Append(heap, item))
179 Pop the smallest item off the heap, maintaining the heap invariant.
190 heapreplace_internal(PyObject *heap, PyObject *item, int siftup_func(PyListObject *, Py_ssize_t))
200 Py_INCREF(item);
201 PyList_SET_ITEM(heap, 0, item);
214 item: object
217 Pop and return the current smallest value, and add the new item.
221 returned may be larger than item! That constrains reasonable uses of
224 if item > heap[0]:
225 item = heapreplace(heap, item)
229 _heapq_heapreplace_impl(PyObject *module, PyObject *heap, PyObject *item)
232 return heapreplace_internal(heap, item, siftup);
239 item: object
242 Push item on the heap, then pop and return the smallest item from the heap.
249 _heapq_heappushpop_impl(PyObject *module, PyObject *heap, PyObject *item)
256 Py_INCREF(item);
257 return item;
262 cmp = PyObject_RichCompareBool(top, item, Py_LT);
267 Py_INCREF(item);
268 return item;
277 Py_INCREF(item);
278 PyList_SET_ITEM(heap, 0, item);
509 item: object
517 PyObject *item)
520 return heapreplace_internal(heap, item, siftup_max);
562 heappush(heap, item) # pushes a new item on the heap\n\
563 item = heappop(heap) # pops the smallest item from the heap\n\
564 item = heap[0] # smallest item on the heap without popping it\n\
566 item = heapreplace(heap, item) # pops and returns smallest item, and adds\n\
567 # new item; the heap size is unchanged\n\
575 - Our heappop() method returns the smallest item, not the largest.\n\
578 without surprises: heap[0] is the smallest item, and heap.sort()\n\
651 Moreover, if you output the 0'th item on disk and get an input which\n\