I are the appeal, but this really seems too special purpose for yet another dunder. A SortedList might be a good addition to the statistics package, however.
I note that with regard to sorting, I suggested a __sort_key dunder so that the sorting routines could know how to efficiently sort arbitrary objects. It was pretty soundly rejected as adding too much overhead for a special case. This is different, but still a special case. It’s easy to think that everyone uses the language like you do, but needling pre-sorted lists is really a pretty special case. And if performance really matters, you should probably be using numpy anyway. -CHB -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/