Any example of Server/Client Side Sorting?

Michael Ströder michael at stroeder.com
Fri May 15 15:02:45 CEST 2009


Zhang Huangbin wrote:
>  >>> cmp=lambda x,y: cmp(x[0].lower(), y[0].lower())
> 
>  >>> alist.sort(cmp)

Ouch! One should probably not mask the standard function name cmp.
So try this:

mycmp=lambda x,y: cmp(x[0].lower(), y[0].lower())
alist.sort(mycmp)

Ciao, Michael.



More information about the python-ldap mailing list