[issue45902] Bytes and bytesarrays can be sorted with a much faster count sort.

Serhiy Storchaka report at bugs.python.org
Sat Nov 27 15:55:49 EST 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I concur with Raymond. It is difficult to find any use case for sorting bytes objects (I cannot find any).

As for using radix sort in list.sort() in special case of small integer keys, it is difficult to implement, because we should preserve the initial order of items with the same key. I am not sure that it is possible to implement stable radix sort with linear complexity. In any case the overhead will be more significant.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45902>
_______________________________________


More information about the Python-bugs-list mailing list