def _CmpToKey(mycmp):
class K(object):<EOL><INDENT>def __init__(self, obj):<EOL><INDENT>self.obj = obj<EOL><DEDENT>def __lt__(self, other):<EOL><INDENT>return mycmp(self.obj, other.obj) == -<NUM_LIT:1><EOL><DEDENT><DEDENT>return K<EOL>
Convert a cmp= function into a key= function