I often do sorts in Python using lambda expressions, and although it works fine, I find it not very readable, and was hoping there might be a better way. Here is a typical use
I suppose if I wanted to create another function, I could do it something like this (not tested):
def sortUsingList(indices, values): return indices[:].sort(key=lambda a: values[a])
Though I think I prefer to use lambda instead to avoid having to create an extra function.