> No, that's incorrect. Try it with this data and you will see it fails:
Of course, you are right, but I think the topic-starter is smart enough to understand that I suggested only a hint, a sketch, a sample of how to use "key=" with "lambda", not a ready-to-apply solution. -- http://mail.python.org/mailman/listinfo/python-list