<div dir="ltr">Well, it's a lot of overhead for a very small bit of convenience. I say let's not do this, it would just encourage people to settle for a slower version. Not everything needs to be OO, you know!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 14, 2016 at 8:06 AM, Joao S. O. Bueno <span dir="ltr"><<a href="mailto:jsbueno@python.org.br" target="_blank">jsbueno@python.org.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
the heapq stdlib module is really handy, but a little low level -<br>
in that it accepts a sequence, possibly only a list, as the heap-object,<br>
and that object have to be handled independently, outside the functions<br>
provided in there. (One can't otherwise insert or delete elements of that list,<br>
without destroying the heap, for example).<br>
<br>
It would be simple to have a higher level class that would do just<br>
that, and simplify the use<br>
of an ordered container - what about having an extra class there?<br>
<br>
I have the snippet bellow I wrote on stack-overflow a couple years ago -<br>
it is very handy.With a little more boiler plate and code hardening,<br>
maybe it could<br>
be a nice thing for the stdlib?<br>
<br>
What do you say?<br>
<br>
<a href="http://stackoverflow.com/questions/8875706/python-heapq-with-custom-compare-predicate/8875823#8875823" rel="noreferrer" target="_blank">http://stackoverflow.com/questions/8875706/python-heapq-with-custom-compare-predicate/8875823#8875823</a><br>
<br>
  js<br>
 -><-<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>