Comment on Perl6: Unary SortparentComments−rmc12yElsewere, say you want to sort a non-omogeneous list, or according to a custom order (attribute1 descending, attribute2 ascending) cmp make this easyYou can do this in python with the key function returning a list/tuple: mylist.sort(key=lambda element: (element.attribute1, -element.attribute2))−_ZeD_12yI'm not sure you can do -"string" :)
Comments
Elsewere, say you want to sort a non-omogeneous list, or according to a custom order (attribute1 descending, attribute2 ascending) cmp make this easy
You can do this in python with the key function returning a list/tuple:
I'm not sure you can do -"string" :)