Guido rethinking removal of cmp from sort method

Chris Angelico rosuav at gmail.com
Tue Mar 29 16:29:44 EDT 2011


On Wed, Mar 30, 2011 at 6:48 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> Not to mention that it still has bugs:
>
> "" < "\0"
> "\xff" < "\xff\xff"

That's because \0 isn't less than any character, nor is \xff greater
than any. However, the latter is true if (for instance) your string is
in UTF-8; it may be possible to use some construct that suits your own
data.

ChrisA



More information about the Python-list mailing list