If the updated datetime collides, the comparator of heapq will move onto the AuthorizationResource value and throws an "unorderable type" error. This adds an index value to the element tuple to ensure that they are always strictly ordered.