functools.cmp_to_key()

functools.cmp_to_key(mycmp)[source]

Convert a cmp= function into a key= function