lets say there's a list of tupples: x = [('foo', 234, 32), ('bar', 213, 123)]; If I want to sort the list by the first element of the tuple should I make a custom compare funciton: def statcmp(t1, t2): if t1[0] < t2[0]: return 1; elif t1[0] == t2[0]: return 0; else: return -1; x.sort(statcmp); Or just sort: x.sort(); Thanks.