On Mon, Apr 8, 2019, 6:26 AM Steven D'Aprano <st...@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.

>
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to