> The sorting is in a performance-critical part of the system, so the > overhead of evaluating a key function is not insignificant.
Can you easily produce an example? It doesn't have to be real data, but should have the structure (typewise) of the real data. I would like to perform some measurements. For example, I could imagine that l = [] for i in range(1000): x = random.randint(0,100) if x < 4: l.append(None) else: l.append(x) might adequately model your problem. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list