Thanks, this will indeed work. I guess I've gotten out of the habit of writing cmp functions since Tim Peter's introduction to the sorting chapter in the first edition of the Python Cookbook convinced me it was inefficient. But the lists should be short here and this should work.
-- http://mail.python.org/mailman/listinfo/python-list