|
|
|
|
|
by _ZeD_
4566 days ago
|
|
They resolve differenti problems: say you have a list of complex object, and you wanna sort by an attribute, you can use mylist.sort(key=lambda element: element.attribute)
Elsewere, say you want to sort a non-omogeneous list, or according to a custom order (attribute1 descending, attribute2 ascending) cmp make this easy |
|