sort the list

Fredrik Lundh fredrik at pythonware.com
Mon Nov 21 09:17:46 EST 2005


Daniel Schüle wrote:
> > what does let cmp = .. away mean?
>
> it means
> lst.sort(lambda x,y: cmp(x[1], y[1]))

note that cmp= isn't needed under 2.4 either.  if you leave it out,
your code will be more portable.

</F>






More information about the Python-list mailing list