[Python-ideas] Higher leavel heapq

Guido van Rossum guido at python.org
Thu Jan 14 11:17:28 EST 2016


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!

On Thu, Jan 14, 2016 at 8:06 AM, Joao S. O. Bueno <jsbueno at python.org.br>
wrote:

> Hi,
>
> the heapq stdlib module is really handy, but a little low level -
> in that it accepts a sequence, possibly only a list, as the heap-object,
> and that object have to be handled independently, outside the functions
> provided in there. (One can't otherwise insert or delete elements of that
> list,
> without destroying the heap, for example).
>
> It would be simple to have a higher level class that would do just
> that, and simplify the use
> of an ordered container - what about having an extra class there?
>
> I have the snippet bellow I wrote on stack-overflow a couple years ago -
> it is very handy.With a little more boiler plate and code hardening,
> maybe it could
> be a nice thing for the stdlib?
>
> What do you say?
>
>
> http://stackoverflow.com/questions/8875706/python-heapq-with-custom-compare-predicate/8875823#8875823
>
>   js
>  -><-
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160114/7bcd776e/attachment.html>


More information about the Python-ideas mailing list