I\'ve got a list of Python objects that I\'d like to sort by an attribute of the objects themselves. The list looks like:
>>> ut [,
Add rich comparison operators to the object class, then use sort() method of the list. See rich comparison in python.
Update: Although this method would work, I think solution from Triptych is better suited to your case because way simpler.