Beispiel #1
0
 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]
Beispiel #2
0
 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]
Beispiel #3
0
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])
Beispiel #5
0
 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])