Re: [Tutor] Fw: utf locale sorting

2009-09-18 Thread Igor Mavrović - ma...@irb
Excellent, the thing works! Thanx a lot! - Original Message - From: Kent Johnson To: Igor Mavrović - ma...@irb Cc: Rich Lovely ; tutor@python.org Sent: Wednesday, September 16, 2009 7:06 PM Subject: Re: [Tutor] Fw: utf locale sorting How about this (assuming both

Re: [Tutor] Fw: utf locale sorting

2009-09-16 Thread Igor Mavrović - ma...@irb
rted(words, key=lambda o: locale.strxfrm(o[0])) can't work 'cause strxfrm's argument must be a string, not a tuple... What do you think? Igor - Original Message - From: Rich Lovely To: Igor Mavrović - ma...@irb Cc: tutor@python.org Sent: Wednesday, September 16, 2009 4

[Tutor] Fw: utf locale sorting

2009-09-16 Thread Igor Mavrović - ma...@irb
Hi, I know about the use of locale module: import locale locale.setlocale(locale.LC_ALL, "hr_HR.UTF8") print sorted(words, key=locale.strxfrm) but I have specific and complicated data structure (list of lists containing strings, tuples and dictionaries) due to LDAP search result data. So I u