[issue31186] Support heapfix() and heapremove() APIs in heapq module

Raymond Hettinger report at bugs.python.org
Sun Aug 13 00:59:13 EDT 2017


Raymond Hettinger added the comment:

-1 I don't think this is the right way to use heaps.  Also, I don't want to introduce any O(n) operations for fine-grained changes of a single element (part of the point of having a heap is to make fine-grained changes cheap).  

FWIW, it isn't common to change an element and then call heapify.  Instead, the usual approach is either mark an entry as invalid or keep a pending deletion list or sets.

----------
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31186>
_______________________________________


More information about the Python-bugs-list mailing list