I've got a list of object in python which i want to sort based on a attribute.
For eg:
abc is a class with attributes id and count.
I have a list objects of the class abc.
list=[abc('1',120),abc('2',0),abc('0',180),abc('5',150)].
I want to sort the list in ascending order of the attribute 'count'
I have done it using:
list.sort(key=attrgetter('count'))
I have found using profiling my python script that it takes lot of time for sorting.
Can anyone suggest a better and faster way to sort list of object based on a attribute minimizing the time for sorting.