what's the effect of cmp here?
d at davea.name
Tue Jul 10 17:11:45 CEST 2012
On 07/10/2012 11:01 AM, levi nie wrote:
> what's the effect of cmp here? The bList and cList is the same at last.
> print "bList is",bList
> print "cList is",cList
The main effect is for the reader of the code. When you supply your own
callback to sort(), you're being explicit about how you want the items
to be compared. If the default works for you, then you can omit
supplying a function.
More information about the Python-list