def _make_cmp(self, seq_op, doc):
def comparer(self, that):<EOL><INDENT>"<STR_LIT>"<EOL>if not isinstance(that, Sequence):<EOL><INDENT>return NotImplemented<EOL><DEDENT>self_len = self._len<EOL>len_that = len(that)<EOL>if self_len != len_that:<EOL><INDENT>if seq_op is op.eq:<EOL><INDENT>return False<EOL><DEDENT>if seq_op is op.ne:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>for alpha, beta in zip(self, that):<EOL><INDENT>if alpha != beta:<EOL><INDENT>return seq_op(alpha, beta)<EOL><DEDENT><DEDENT>return seq_op(self_len, len_that)<EOL><DEDENT>comparer.__name__ = '<STR_LIT>'.format(seq_op.__name__)<EOL>doc_str = '<STR_LIT>'<EOL>comparer.__doc__ = doc_str.format(doc)<EOL>return comparer<EOL>
Make comparator method.