def sort(self, reverse=False): """ Sort in place """ o = rli.order(self, reverse=reverse) super(TaggedList, self).sort(reverse=reverse) self.__tags = [self.__tags[i] for i in o]
def sort(self, reverse = False): """ Sort in place """ o = rli.order(self, reverse = reverse) super(TaggedList, self).sort(reverse = reverse) self.__tags = [self.__tags[i] for i in o]
def test_order(): seq = (2, 1, 5, 3, 4) expected = (1, 2, 3, 4, 5) res = rfi.order(seq) for va, vb in zip(expected, res): assert seq[vb] == va
def testOrder(self): seq = ( 2, 1, 5, 3, 4) expected = (1, 2, 3, 4, 5) res = rfi.order(seq) for va, vb in itertools.izip(expected, res): self.assertEquals(va, seq[vb])
def testOrder(self): seq = (2, 1, 5, 3, 4) expected = (1, 2, 3, 4, 5) res = rfi.order(seq) for va, vb in zip(expected, res): self.assertEqual(va, seq[vb])