[Python-ideas] collections.sortedset proposal

Michele Lacchia michelelacchia at gmail.com
Wed Dec 26 18:43:34 CET 2012


For the record, there is another implementation of skiplists on PyPI:
http://pypi.python.org/pypi/skiplist/0.1.0


2012/12/26 Paul Colomiets <paul at colomiets.name>

> Hi Nick,
>
> On Wed, Dec 26, 2012 at 4:32 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> >> The problem with heap queue (as implemented in python) as priority
> >> queue or list of timers is that it does not support deletion of the
> >> tasks (at least not in efficient manner). For other use cases, e.g.
> >> for a leader board heapq doesn't allow efficient slicing.
> >>
> >> Or do you mean "heap queue" is a nice name for the data structure that
> >> redis calls "sorted set"?
> >
> > I mean if what you want is a heap queue with a more efficient
> > heappop() implementation (due to a different underlying data
> > structure), then it's probably clearer to call it that.
> >
>
> The underlying data structure is skiplists not heap. It would be
> strange to call it heap-something.  But, yes, for the discussion,
> similarity with heapqueue may be a better starting point.
>
> --
> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



-- 
Michele Lacchia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121226/d057bd93/attachment.html>


More information about the Python-ideas mailing list