A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-November/040209.html below:

[Python-Dev] Re: other "magic strings" issues

[Python-Dev] Re: other "magic strings" issues [Python-Dev] Re: other "magic strings" issuesMartin v. Löwis martin at v.loewis.de
Wed Nov 12 15:31:42 EST 2003
David Eppstein <eppstein at ics.uci.edu> writes:

> Let me be more specific.  Since we have such useful hashing-based 
> dictionary data structures in Python, we don't often need cmp for 
> binary search trees, so the main reason for comparing unicodes (as far 
> as I can tell) is to put them in a logical order for displaying to 
> humans.  cmp(unicode,unicode) does a very bad job of this, whenever 
> there are non-ascii characters involved.  Its existence tricks you into 
> thinking Python has a useful unicode comparison function when it 
> doesn't.

It's useful for sorting, but not for collation. Comparing!=Collating.

That said, locale.strcoll does what you want.

Regards,
Martin

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4