Re: Reworking diffutil.Differ



     def set_sequences_iter(self, *sequences):
        assert 0 <= len(sequences) <= 3
        self.diffs = [[], []]
        self.num_sequences = len(sequences)
        self.seqlength = [len(s) for s in sequences]

        if self.num_sequences >1:
             for i in range(self.num_sequences - 1):
                 matcher = IncrementalSequenceMatcher(None,
sequences[1], sequences[i*2])
                 work = matcher.initialise()
                 while work.next() == None:
                     yield None
                self.diffs[i] = matcher.get_difference_opcodes()
         yield 1

Looks even shorter to me

-- 
Vincent Legoll


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]