Re: localizing a sort

2007-09-02 Thread Ricardo Aráoz
Alex Martelli wrote: > Ricardo Aráoz <[EMAIL PROTECTED]> wrote: >> Peter Otten wrote: >... >>> print ''.join(sorted(a, cmp=lambda x,y: locale.strcoll(x,y))) aeiouàáäèéëìíïòóöùúü >>> The lambda is superfluous. Just write cmp=locale.strcoll instead. >> No it is not : > print ''.join(

Re: localizing a sort

2007-09-02 Thread Alex Martelli
Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > Peter Otten wrote: ... > > print ''.join(sorted(a, cmp=lambda x,y: locale.strcoll(x,y))) > >> aeiouàáäèéëìíïòóöùúü > > > > The lambda is superfluous. Just write cmp=locale.strcoll instead. > > No it is not : > >>> print ''.join(sorted(a, cmp=local

Re: localizing a sort

2007-09-02 Thread Ricardo Aráoz
Peter Otten wrote: > Am Sat, 01 Sep 2007 18:56:38 -0300 schrieb Ricardo Aráoz: > >> Hi, I've been working on sorting out some words. >> >> My locale is : > import locale > locale.getdefaultlocale() >> ('es_AR', 'cp1252') >> >> I do : > a = 'áéíóúäëïöüàèìòù' > print ''.join(sorted(a

Re: localizing a sort

2007-09-02 Thread Peter Otten
Am Sat, 01 Sep 2007 18:56:38 -0300 schrieb Ricardo Aráoz: > Hi, I've been working on sorting out some words. > > My locale is : import locale locale.getdefaultlocale() > ('es_AR', 'cp1252') > > I do : a = 'áéíóúäëïöüàèìòù' print ''.join(sorted(a, cmp=lambda x,y: locale.strcol