Use key argument in sort calls
|Reported by:||loewis||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Now that Python 2.4 is the minimum supported version, it is possible to replace all comparison functions with key functions. The attached patch does that.
Doing so has two advantages:
- it may be slightly faster, in particular, if the comparing the key values is faster than calling the cmp function
- it helps moving Django towards Python 3, which doesn't support the compare function anymore.
With the patch, I don't get any additional failures when testing on trunk.