what's the effect of cmp here?

levi nie levinie001 at gmail.com
Tue Jul 10 17:01:27 CEST 2012


what's the effect of cmp here? The bList and cList is the same at last.

code:
aList=[3,2,5,4]

bList=aList[:]
bList.sort()
print "bList is",bList

cList=aList[:]
cList.sort(cmp)
print "cList is",cList
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120710/d9e3ec13/attachment.html>


More information about the Python-list mailing list