[Python-ideas] Sorted lists

David Mertz mertz at gnosis.cx
Mon Apr 8 08:00:32 EDT 2019


On Mon, Apr 8, 2019, 6:26 AM Steven D'Aprano <steve at pearwood.info> wrote:

> Given all the points already raised, I think that an explicit SortedList
> might be more appropriate.
>

This one looks cool. I've read about it, but haven't used it:
http://www.grantjenks.com/docs/sortedcontainers/

I think a "sort hint" should be a read-only attribute of some collections,
and statistics should look for the presence of that. You might need to get
third parties to follow that convention, but you're no worse than now if
they don't. Burdening list with a vague suggestion about an invariant it
doesn't maintain is a bad idea.

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190408/2532a1fb/attachment.html>


More information about the Python-ideas mailing list