Re: what's the effect of cmp here?
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.
|All times are GMT. The time now is 07:33 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.