def __lt__(self, other):
<EOL>if self.priority == other.priority:<EOL><INDENT>localkeys = self.next_value.keys()<EOL>otherkeys = other.next_value.keys()<EOL>shared_keys = sorted(set(localkeys).intersection(otherkeys))<EOL>for key in shared_keys:<EOL><INDENT>if self.next_value[key] != other.next_value[key]:<EOL><INDENT>return self.next_value[key] < other.next_value[key]<EOL><DEDENT><DEDENT><DEDENT>return self.priority < other.priority<EOL>
Allow order testing via '<' operator, needed by priority queue.