예제 #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]
예제 #2
0
파일: container.py 프로젝트: gyenney/Tools
 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]
예제 #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
예제 #4
0
 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])
예제 #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])