Ordering a list of dictionaries in python,"mylist.sort(key=lambda d: (d['weight'], d['factor']))"