Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In python2, for the sorted and list.sort functions, what is the difference between the key argument vs the cmp argument?
Answer
key does a comparison against some derivitive of the list values being compared (e.g. len, for length) whereas cmp uses a custom functions to compare the whole of the two list items being compared (e.g. comparing release number 1.2 and 1.2.1 via a custom function)

Question
In python2, for the sorted and list.sort functions, what is the difference between the key argument vs the cmp argument?
Answer
?

Question
In python2, for the sorted and list.sort functions, what is the difference between the key argument vs the cmp argument?
Answer
key does a comparison against some derivitive of the list values being compared (e.g. len, for length) whereas cmp uses a custom functions to compare the whole of the two list items being compared (e.g. comparing release number 1.2 and 1.2.1 via a custom function)

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.