Just for grins, what happens if you change that code to be:
Code:
for r in reversed(results):
ans.identifiers.update(r.identifiers)
My thought is that if results is sorted highest-priority first, then processing them in reverse will leave the one you want. However, if identifiers is not ordered, then this suggestion is bogus.
EDIT: Never mind. 'results' is not a list.