Find why this comparator does not implement the contract required by cmp_to_key().
Python
from functools import cmp_to_key
def compare_priority(left, right):
return left["priority"] < right["priority"]
tickets = [{"priority": 2}, {"priority": 1}]
print(sorted(tickets, key=cmp_to_key(compare_priority)))